Function

AudioConverterFillComplexBuffer

Converts audio data supplied by a callback function, supporting non-interleaved and packetized formats.

Declaration

OSStatus AudioConverterFillComplexBuffer(AudioConverterRef inAudioConverter, AudioConverterComplexInputDataProc inInputDataProc, void *inInputDataProcUserData, UInt32 *ioOutputDataPacketSize, AudioBufferList *outOutputData, AudioStreamPacketDescription *outPacketDescription);

Parameters

inAudioConverter

The audio converter to use for format conversion.

inInputDataProc

A callback function that supplies audio data to convert. This callback is invoked repeatedly as the converter is ready for new input data.

inInputDataProcUserData

Custom data for use by your application when receiving a callback invocation.

ioOutputDataPacketSize

On input, the size of the output buffer (in the outOutputData parameter), expressed in number packets in the audio converter’s output format. On output, the number of packets of converted data that were written to the output buffer.

outOutputData

On output, the converted audio data.

outPacketDescription

On input, must point to a block of memory capable of holding the number of packet descriptions specified in the ioOutputDataPacketSize parameter. (See Audio Format Services Reference for functions that let you determine whether an audio format uses packet descriptions). If not NULL on output and if the audio converter’s output format uses packet descriptions, then this parameter contains an array of packet descriptions.

Return Value

A result code.

Discussion

Use this function for all audio data format conversions except for the special case of converting from one linear PCM format to another with no sample rate conversion.

See Also

Performing Conversions

AudioConverterConvertBuffer

Converts audio data from one linear PCM format to another.

AudioConverterConvertComplexBuffer

Converts audio data from one linear PCM format to another, where both use the same sample rate.