#include <icy/av/audiobuffer.h>FIFO buffer for queuing audio samples between encoding stages.
| Return | Name | Description |
|---|---|---|
AVAudioFifo * | fifo | Underlying FFmpeg audio FIFO handle. |
AVAudioFifo * fifoUnderlying FFmpeg audio FIFO handle.
| Return | Name | Description |
|---|---|---|
AudioBuffer | ||
AudioBuffer | Deleted constructor. | |
AudioBuffer | Deleted constructor. | |
void | alloc | Allocate the audio FIFO buffer. |
void | reset | Discard all samples currently held in the FIFO without freeing the buffer. |
void | close | Free the underlying AVAudioFifo buffer. |
void | write | Write samples into the FIFO buffer. |
bool | read | Read samples from the FIFO buffer. |
int | available const | Return the number of samples per channel currently available in the FIFO. |
AudioBuffer()AudioBuffer(const AudioBuffer &) = deleteDeleted constructor.
AudioBuffer(AudioBuffer &&) = deleteDeleted constructor.
void alloc(const std::string & sampleFmt, int channels, int numSamples)Allocate the audio FIFO buffer.
sampleFmt The sample format name (e.g. "s16", "fltp").
channels The number of audio channels.
numSamples The initial buffer capacity in samples per channel.
void reset()Discard all samples currently held in the FIFO without freeing the buffer.
void close()Free the underlying AVAudioFifo buffer.
void write(void ** samples, int numSamples)Write samples into the FIFO buffer.
samples Array of per-channel sample buffers.
numSamples The number of samples per channel to write.
bool read(void ** samples, int numSamples)Read samples from the FIFO buffer.
samples Array of per-channel sample buffers to fill.
numSamples The number of samples per channel to read.
True if enough samples were available.
const
int available() constReturn the number of samples per channel currently available in the FIFO.
The number of available samples, or zero if the buffer is not allocated.