AudioRecord.ReadAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| ReadAsync(ByteBuffer, Int32) |
Starts a task that calls the blocking byte-buffer read. |
| ReadAsync(ByteBuffer, Int32, Int32) |
Starts a task that calls the byte-buffer read with the supplied read mode. |
| ReadAsync(Byte[], Int32, Int32) |
Starts a task that calls the blocking byte-array read. |
| ReadAsync(Int16[], Int32, Int32) |
Starts a task that calls the blocking 16-bit sample-array read. |
| ReadAsync(Byte[], Int32, Int32, Int32) |
Starts a task that calls the byte-array read with the supplied read mode. |
| ReadAsync(Int16[], Int32, Int32, Int32) |
Starts a task that calls the 16-bit sample-array read with the supplied read mode. |
| ReadAsync(Single[], Int32, Int32, Int32) |
Starts a task that calls the floating-point sample-array read. |
ReadAsync(ByteBuffer, Int32)
Starts a task that calls the blocking byte-buffer read.
public System.Threading.Tasks.Task<int> ReadAsync(Java.Nio.ByteBuffer audioBuffer, int sizeInBytes);
member this.ReadAsync : Java.Nio.ByteBuffer * int -> System.Threading.Tasks.Task<int>
Parameters
- audioBuffer
- ByteBuffer
The direct byte buffer that receives data at its beginning, regardless of its position and limit.
- sizeInBytes
- Int32
The requested maximum byte count for the underlying read.
Returns
A task with the byte count read, possibly zero, or a negative read error code.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ReadAsync(ByteBuffer, Int32, Int32)
Starts a task that calls the byte-buffer read with the supplied read mode.
public System.Threading.Tasks.Task<int> ReadAsync(Java.Nio.ByteBuffer audioBuffer, int sizeInBytes, int readMode);
member this.ReadAsync : Java.Nio.ByteBuffer * int * int -> System.Threading.Tasks.Task<int>
Parameters
- audioBuffer
- ByteBuffer
The direct byte buffer that receives data at its beginning, regardless of its position and limit.
- sizeInBytes
- Int32
The requested maximum byte count for the underlying read.
- readMode
- Int32
Zero for blocking reads or one for nonblocking reads in the underlying synchronous call.
Returns
A task with the byte count read, possibly zero, or a negative read error code.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ReadAsync(Byte[], Int32, Int32)
Starts a task that calls the blocking byte-array read.
public System.Threading.Tasks.Task<int> ReadAsync(byte[] audioData, int offsetInBytes, int sizeInBytes);
member this.ReadAsync : byte[] * int * int -> System.Threading.Tasks.Task<int>
Parameters
- audioData
- Byte[]
The destination array for the recorded bytes.
- offsetInBytes
- Int32
The starting destination index, in bytes.
- sizeInBytes
- Int32
The maximum number of bytes to read after that index.
Returns
A task with the byte count read, possibly zero, or a negative read error code.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ReadAsync(Int16[], Int32, Int32)
Starts a task that calls the blocking 16-bit sample-array read.
public System.Threading.Tasks.Task<int> ReadAsync(short[] audioData, int offsetInShorts, int sizeInShorts);
member this.ReadAsync : int16[] * int * int -> System.Threading.Tasks.Task<int>
Parameters
- audioData
- Int16[]
The destination array for recorded 16-bit samples.
- offsetInShorts
- Int32
The starting destination index, in 16-bit array elements.
- sizeInShorts
- Int32
The maximum number of 16-bit array elements to read.
Returns
A task with the number of 16-bit array elements read, possibly zero, or a negative read error code.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ReadAsync(Byte[], Int32, Int32, Int32)
Starts a task that calls the byte-array read with the supplied read mode.
public System.Threading.Tasks.Task<int> ReadAsync(byte[] audioData, int offsetInBytes, int sizeInBytes, int readMode);
member this.ReadAsync : byte[] * int * int * int -> System.Threading.Tasks.Task<int>
Parameters
- audioData
- Byte[]
The destination array for the recorded bytes.
- offsetInBytes
- Int32
The starting destination index, in bytes.
- sizeInBytes
- Int32
The maximum number of bytes to read after that index.
- readMode
- Int32
Zero for blocking reads or one for nonblocking reads in the underlying synchronous call.
Returns
A task with the byte count read, possibly zero, or a negative read error code.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ReadAsync(Int16[], Int32, Int32, Int32)
Starts a task that calls the 16-bit sample-array read with the supplied read mode.
public System.Threading.Tasks.Task<int> ReadAsync(short[] audioData, int offsetInShorts, int sizeInShorts, int readMode);
member this.ReadAsync : int16[] * int * int * int -> System.Threading.Tasks.Task<int>
Parameters
- audioData
- Int16[]
The destination array for recorded 16-bit samples.
- offsetInShorts
- Int32
The starting destination index, in 16-bit array elements.
- sizeInShorts
- Int32
The maximum number of 16-bit array elements to read.
- readMode
- Int32
Zero for blocking reads or one for nonblocking reads in the underlying synchronous call.
Returns
A task with the number of 16-bit array elements read, possibly zero, or a negative read error code.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ReadAsync(Single[], Int32, Int32, Int32)
Starts a task that calls the floating-point sample-array read.
public System.Threading.Tasks.Task<int> ReadAsync(float[] audioData, int offsetInFloats, int sizeInFloats, int readMode);
member this.ReadAsync : single[] * int * int * int -> System.Threading.Tasks.Task<int>
Parameters
- audioData
- Single[]
The destination array for recorded floating-point samples.
- offsetInFloats
- Int32
The starting destination index, in single-precision array elements.
- sizeInFloats
- Int32
The maximum number of floating-point array elements to read.
- readMode
- Int32
Zero for blocking reads or one for nonblocking reads in the underlying synchronous call.
Returns
A task with the number of floating-point array elements read, possibly zero, or a negative read error code.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.