<!--
{
  "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(commonFormat:sampleRate:channels:interleaved:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioFormat(im)initWithCommonFormat:sampleRate:channels:interleaved:"
  },
  "title" : "init(commonFormat:sampleRate:channels:interleaved:)"
}
-->

# init(commonFormat:sampleRate:channels:interleaved:)

Creates an audio format instance.

```
init?(commonFormat format: AVAudioCommonFormat, sampleRate: Double, channels: AVAudioChannelCount, interleaved: Bool)
```

## Parameters

`format`

The audio format.

`sampleRate`

The sampling rate, in hertz.

`channels`

The channel count.

`interleaved`

The Boolean value that indicates whether `format` is in an interleaved state.

## Return Value

A new `AVAudioFormat` instance, or `nil` if the initialization fails.

## Discussion

For information about possible `format` values, see [`AVAudioCommonFormat`](/documentation/AVFAudio/AVAudioCommonFormat).

## See Also

[`sampleRate`](/documentation/AVFAudio/AVAudioFormat/sampleRate)

The audio format sampling rate, in hertz.

[`isInterleaved`](/documentation/AVFAudio/AVAudioFormat/isInterleaved)

A Boolean value that indicates whether the samples mix into one stream.

[`commonFormat`](/documentation/AVFAudio/AVAudioFormat/commonFormat)

The common format identifier instance.



---

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)