Function

AudioConverterConvertBuffer

Converts audio data from one linear PCM format to another.

Declaration

OSStatus AudioConverterConvertBuffer(AudioConverterRef inAudioConverter, UInt32 inInputDataSize, const void *inInputData, UInt32 *ioOutputDataSize, void *outOutputData);

Parameters

inAudioConverter

The audio converter to use for format conversion.

inInputDataSize

The size, in bytes, of the audio data input buffer.

inInputData

The audio data to convert.

ioOutputDataSize

On input, the size, in bytes, of the buffer available for the converted data. On output, the number of bytes written to the output buffer (pointed to by the outOutputData parameter).

outOutputData

On output, the converted audio data.

Return Value

A result code.

Discussion

This function is for the special case of converting from one linear PCM format to another. This function cannot perform sample rate conversions and cannot be used for conversion to or from most compressed formats. To perform these types of conversion, use AudioConverterFillComplexBuffer instead.

See Also

Performing Conversions

AudioConverterFillComplexBuffer

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

AudioConverterConvertComplexBuffer

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