Constructor
new AudioWriter()
From a RingBuffer, build an object that can enqueue enqueue audio in a ring
buffer.
- Source:
Classes
Methods
available_write()
- Source:
Returns:
The free space in the ring buffer. This is the amount of samples
that can be queued, with a guarantee of success.
enqueue(buf)
Enqueue a buffer of interleaved audio into the ring buffer.
Care should be taken to enqueue a number of samples that is a multiple of the
channel count of the audio stream.
Parameters:
Name | Type | Description |
---|---|---|
buf |
Float32Array | An array of interleaved audio frames. |
- Source:
Returns:
The number of samples that have been successfuly written to the
queue. `buf` is not written to during this call, so the samples that
haven't been written to the queue are still available.