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