Instance Method

initStandardFormatWithSampleRate:channels:

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

Declaration

- (instancetype)initStandardFormatWithSampleRate:(double)sampleRate channels:(AVAudioChannelCount)channels;

Parameters

sampleRate

The sample rate, in hertz.

channels

The channel count.

Return Value

An initialized AVAudioFormat instance.

Discussion

The returned AVAudioFormat instance uses the AVAudioPCMFormatFloat32 format.

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.

- initWithCommonFormat:sampleRate:channels:interleaved:

Initializes a newly allocated audio format instance

- 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.