AudioConverterFillComplexBuffer(_:_:_:_:_:_:)
Converts audio data supplied by a callback function, supporting non-interleaved and packetized formats.
Declaration
func AudioConverterFillComplexBuffer(_ inAudioConverter: AudioConverterRef, _ inInputDataProc: AudioConverterComplexInputDataProc, _ inInputDataProcUserData: UnsafeMutableRawPointer?, _ ioOutputDataPacketSize: UnsafeMutablePointer<UInt32>, _ outOutputData: UnsafeMutablePointer<AudioBufferList>, _ outPacketDescription: UnsafeMutablePointer<AudioStreamPacketDescription>?) -> OSStatusParameters
- 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
outOutputDataparameter), 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
ioOutputDataPacketSizeparameter. (See Audio Format Services Reference for functions that let you determine whether an audio format uses packet descriptions). If notNULLon 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.