Initializer

init(settings:)

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

Declaration

init?(settings: [String : Any])

Parameters

settings

The settings dictionary. See Audio Settings and Formats for supported key/value pairs.

Return Value

An initialized AVAudioFormat instance.

Discussion

Many settings dictionary elements pertain to encoder settings, not the basic format, and will be ignored.

See Also

Creating a New Audio Format Representation

init(standardFormatWithSampleRate: Double, channelLayout: AVAudioChannelLayout)

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

init?(standardFormatWithSampleRate: Double, channels: AVAudioChannelCount)

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

init(commonFormat: AVAudioCommonFormat, sampleRate: Double, interleaved: Bool, channelLayout: AVAudioChannelLayout)

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

init?(streamDescription: UnsafePointer<AudioStreamBasicDescription>)

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

init?(streamDescription: UnsafePointer<AudioStreamBasicDescription>, channelLayout: AVAudioChannelLayout?)

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

init(cmAudioFormatDescription: CMAudioFormatDescription)

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