<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioFormat/init(streamDescription:channelLayout:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioFormat(im)initWithStreamDescription:channelLayout:"
  },
  "title" : "init(streamDescription:channelLayout:)"
}
-->

# init(streamDescription:channelLayout:)

Creates an audio format instance from a stream description and channel layout.

```
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 <doc://com.apple.documentation/documentation/CoreAudioTypes/AudioStreamBasicDescription> specifies more than two channels and `layout` is `nil`, this method fails and returns `nil`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)