init(format:packetCapacity:)
Creates a buffer that contains constant bytes per packet of audio data in a compressed state.
Declaration
init(format: AVAudioFormat, packetCapacity: AVAudioPacketCount)Parameters
- format:
The format of the audio the buffer contains.
- packetCapacity:
The capacity of the buffer, in packets.
Return Value
A new AVAudioCompressedBuffer instance.
Discussion
This fails if the format is PCM or if the format has variable bytes per packet (for example, format.streamDescription->mBytesPerPacket == 0).