AudioFileWritePackets(_:_:_:_:_:_:_:)
Writes packets of audio data to an audio data file.
Declaration
func AudioFileWritePackets(_ inAudioFile: AudioFileID, _ inUseCache: Bool, _ inNumBytes: UInt32, _ inPacketDescriptions: UnsafePointer<AudioStreamPacketDescription>?, _ inStartingPacket: Int64, _ ioNumPackets: UnsafeMutablePointer<UInt32>, _ inBuffer: UnsafeRawPointer) -> OSStatusParameters
- inAudioFile:
The audio file to write to.
- inUseCache:
Set to
trueif you want to cache the data. Otherwise, set tofalse. - inNumBytes:
The number of bytes of audio data being written.
- inPacketDescriptions:
A pointer to an array of packet descriptions for the audio data. Not all formats require packet descriptions. If no packet descriptions are required, for instance, if you are writing CBR data, pass
NULL. - inStartingPacket:
The packet index for the placement of the first provided packet.
- ioNumPackets:
On input, a pointer to the number of packets to write. On output, a pointer to the number of packets actually written.
- inBuffer:
A pointer to user-allocated memory containing the new audio data to write to the audio data file.
Return Value
A result code. See Result Codes.
Discussion
For all uncompressed formats, this function equates packets with frames.