init(compressedAudioDataBuffer:formatDescription:presentationTimeStamp:packetDescriptions:)
Creates a sample buffer carrying compressed audio media data.
Declaration
init(compressedAudioDataBuffer content: Content, formatDescription: CMAudioFormatDescription, presentationTimeStamp: CMTime, packetDescriptions: [AudioStreamPacketDescription])Parameters
- formatDescription:
Format description of the content. The format must have audio media type.
- presentationTimeStamp:
The time at which the first sample will be presented. Must be valid numeric time.
- packetDescriptions:
Array of packet descriptions one for each sample.
Discussion
Use this init when the audio format where the packet size isn’t constant, such as variable bit rate or when the channels have unequal sizes. The packetDescriptions are used along with presentationTimeStamp to calculate the sample count, sample sizes & sample timings.