init(streamDescription:channelLayout:)
Creates an audio format instance from a stream description and channel layout.
Declaration
init?(streamDescription asbd: UnsafePointer<AudioStreamBasicDescription>, channelLayout layout: AVAudioChannelLayout?)Parameters
- asbd:
The audio stream description.
- layout:
The channel layout.
Return Value
A new AVAudioFormat instance, or nil if the initialization fails.
Discussion
When layout is nil, and asbd specifies one or two channels, this method assumes mono or stereo layout, respectively.
If the AudioStreamBasicDescription specifies more than two channels and layout is nil, this method fails and returns nil.