AudioBufferList Utility Functions
These functions make working with AudioBufferLists easier.
- Creating and Disposing
- Working with attributes
- Working with data
unsigned MTAudioBufferListChannelCount ( const AudioBufferList * buf )
Returns the sum of the number of channels in each buffer/stream in buf.
unsigned MTAudioBufferListClear ( AudioBufferList * aList, unsigned offset, unsigned count )
Sets audio frames in theList, starting at offset frames from the beginning, to silence. The number of frames cleared
is the smallest of:
Returns the number of frames cleared.
- The frame count of aList minus offset
- Parameter count
unsigned MTAudioBufferListCopy ( const AudioBufferList * src, unsigned srcOffset, AudioBufferList * dst, unsigned dstOffset, unsigned count )
Copies audio frames from src, starting at srcOffset frames from the beginning, to dst, starting at dstOffset frames from the beginning.
The number frames copied is the smallest of:
If src has more channels than dst, then the excess channels of src are discarded. If src has fewer
channels than dst, then the excess channels of dst are filled with silence.
- The frame count of src minus srcOffset
- The frame count of dst minus dstOffset
- Parameter count
This function can work with source and destination AudioBufferLists having different numbers of streams and different numbers of channels per stream.
However, it is most efficient when all of the corresponding streams in src and dst have the same number of channels.
Returns the number of frames copied.
void MTAudioBufferListDispose ( AudioBufferList * aList )
Frees all of the resources of AudioBufferList aList.
unsigned MTAudioBufferListFrameCount ( const AudioBufferList * buf )
Returns the number of audio frames that buf can hold.
AudioBufferList * MTAudioBufferListNew ( unsigned channels, unsigned frames, Boolean interleaved )
Returns a new AudioBufferList large enough to hold frames frames of channels-channel Float32 audio samples.
If interleaved is
YES, then the AudioBufferList will have one AudioBuffer with channels
interleaved channels. If interleaved is
NO, then the AudioBufferList will have
channels AudioBuffers each one channel wide.
void MTAudioBufferListSetFrameCount ( AudioBufferList * buf, count )
mDataByteSize field in each of buf's
AudioBuffers to indicate that the buffer can hold count frames of audio. IMPORTANT: This function does not ensure that each AudioBuffer's
mData points to a buffer large enough to hold count frames. This function is intended mainly to reset
mDataByteSize after functions like
AudioConverterFillComplexBuffer() change it.
Mac OS X >
MTCoreAudio AudioBufferList Utility Functions