Constructor
new AudioReader()
From a RingBuffer, build an object that can dequeue audio in a ring
buffer.
- Source:
Classes
Methods
available_read()
Query the occupied space in the queue.
- Source:
Returns:
The amount of samples that can be read with a guarantee of success.
dequeue(buf)
Attempt to dequeue at most `buf.length` samples from the queue. This
returns the number of samples dequeued. If greater than 0, the samples are
at the beginning of `buf`.
Care should be taken to dequeue a number of samples that is a multiple of the
channel count of the audio stream.
Parameters:
Name | Type | Description |
---|---|---|
buf |
Float32Array | A buffer in which to copy the dequeued interleaved audio frames. |
- Source:
Returns:
The number of samples dequeued.