AudioFileStream_PacketsProc
Invoked by an audio file stream parser when it finds audio data in the audio file stream.
Declaration
typealias AudioFileStream_PacketsProc = (UnsafeMutableRawPointer, UInt32, UInt32, UnsafeRawPointer, UnsafeMutablePointer<AudioStreamPacketDescription>?) -> VoidParameters
- inClientData:
The value you provided in the
inClientDataparameter when you called the Audiofilestreamopen(_:_:_:_:_:) function. - inNumberBytes:
The number of bytes of data in the
inInputDatabuffer. - inNumberPackets:
The number of packets of audio data in the
inInputDatabuffer. - inInputData:
The audio data.
- inPacketDescriptions:
An array of audio file stream packet description structures describing the data. Audio file stream packet description structures are described in Core Audio Data Types.
Discussion
If you named your function MyAudioFileStream_PacketsProc, you would declare it like this:
Discussion
For constant-bit-rate (CBR) audio data, your callback is typically called with as much data as you passed to the AudioFileStreamParseBytes(_:_:_:_:) function. At times, however, only a single packet might be passed because of boundaries in the input data. For variable-bit-rate (VBR) audio data, your callback might be called several times for each time you called the AudioFileStreamParseBytes(_:_:_:_:) function.