Instance Method

initWithStreamDescription:

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

Declaration

- (instancetype)initWithStreamDescription:(const AudioStreamBasicDescription *)asbd;

Parameters

asbd

Return Value

An initialized AVAudioFormat instance, or nil if the initialization fails.

Discussion

If the AudioStreamBasicDescription specifies more than 2 channels, this method fails and returns nil. Instead you should use the initWithStreamDescription:channelLayout: method.

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