A subclass of AVAudioBuffer for use with compressed audio formats.


class AVAudioCompressedBuffer : AVAudioBuffer


Creating an Audio Buffer

init(format: AVAudioFormat, packetCapacity: AVAudioPacketCount)

Initializes a buffer for compressed audio data.

init(format: AVAudioFormat, packetCapacity: AVAudioPacketCount, maximumPacketSize: Int)

Initializes a buffer with constant bytes per packet for compressed audio data.

Getting Audio Buffer Properties

var byteCapacity: UInt32

The buffer's capacity, in bytes.

var byteLength: UInt32

The number of valid bytes in the buffer.

var data: UnsafeMutableRawPointer

The buffer's data bytes.

var maximumPacketSize: Int

The maximum size, in bytes, of a compressed packet.

var packetCapacity: AVAudioPacketCount

The number of compressed packets the buffer can contain.

var packetCount: AVAudioPacketCount

The number of compressed packets in the buffer.

typealias AVAudioPacketCount

A number of packets of compressed audio data.


Inherits From

Conforms To

See Also

Specialized Audio Buffers

class AVAudioPCMBuffer

A subclass of AVAudioBuffer, for use with PCM audio formats.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software