Initializer

init(standardFormatWithSampleRate:channels:)

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

Declaration

init?(standardFormatWithSampleRate sampleRate: Double, channels: AVAudioChannelCount)

Parameters

sampleRate

The sample rate, in hertz.

channels

The channel count.

Return Value

An initialized AVAudioFormat instance.

Discussion

The returned AVAudioFormat instance uses the AVAudioCommonFormat.pcmFormatFloat32 format.

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(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?(settings: [String : Any])

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

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.