Instance Method

initWithCommonFormat:sampleRate:channels:interleaved:

Initializes a newly allocated audio format instance

Declaration

- (instancetype)initWithCommonFormat:(AVAudioCommonFormat)format sampleRate:(double)sampleRate channels:(AVAudioChannelCount)channels interleaved:(BOOL)interleaved;

Parameters

format

The audio format. See AVAudioCommonFormat for values.

sampleRate

The sample rate, in hertz.

channels

The channel count.

interleaved

YES if the audio format is interleaved; otherwise NO.

Return Value

An initialized AVAudioFormat instance.

See Also

Creating a New Audio Format Representation

- initStandardFormatWithSampleRate:channelLayout:

Initializes a newly allocated audio format instance as a deinterleaved float with the specified sample rate and channel layout.

- initStandardFormatWithSampleRate:channels:

Initializes a newly allocated audio format instance with the specified sample rate and channel count.

- initWithCommonFormat:sampleRate:interleaved:channelLayout:

Initializes a newly allocated audio format instance with the specified auto format, sample rate, interleaved format and channel layout.

- initWithSettings:

Initializes a newly allocated audio format instance using a settings dictionary.

- initWithStreamDescription:

Initializes a newly allocated audio format instance from a stream description.

- initWithStreamDescription:channelLayout:

Initializes a newly allocated audio format instance from a stream description and channel layout.

- initWithCMAudioFormatDescription:

Initializes a newly allocated audio format instance from a Core Media audio format description.