<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioFormat"
  },
  "title" : "AVAudioFormat"
}
-->

# AVAudioFormat

An object that describes the representation of an audio format.

```
class AVAudioFormat
```

## Overview

The [`AVAudioFormat`](/documentation/AVFAudio/AVAudioFormat) class wraps Core Audio’s <doc://com.apple.documentation/documentation/CoreAudioTypes/AudioStreamBasicDescription>, and includes convenience initializers and accessors for common formats, including Core Audio’s standard deinterleaved 32-bit floating point format.

Instances of this class are immutable.

## Topics

### Creating a New Audio Format Representation

[`-  initStandardFormatWithSampleRate:channelLayout:`](/documentation/AVFAudio/AVAudioFormat/init(standardFormatWithSampleRate:channelLayout:))

Creates an audio format instance as a deinterleaved float with the specified sample rate and channel layout.

[`-  initStandardFormatWithSampleRate:channels:`](/documentation/AVFAudio/AVAudioFormat/init(standardFormatWithSampleRate:channels:))

Creates an audio format instance with the specified sample rate and channel count.

[`-  initWithCommonFormat:sampleRate:channels:interleaved:`](/documentation/AVFAudio/AVAudioFormat/init(commonFormat:sampleRate:channels:interleaved:))

Creates an audio format instance.

[`-  initWithCommonFormat:sampleRate:interleaved:channelLayout:`](/documentation/AVFAudio/AVAudioFormat/init(commonFormat:sampleRate:interleaved:channelLayout:))

Creates an audio format instance with the specified audio format, sample rate, interleaved state, and channel layout.

[`-  initWithSettings:`](/documentation/AVFAudio/AVAudioFormat/init(settings:))

Creates an audio format instance using the specified settings dictionary.

[`-  initWithStreamDescription:`](/documentation/AVFAudio/AVAudioFormat/init(streamDescription:))

Creates an audio format instance from a stream description.

[`-  initWithStreamDescription:channelLayout:`](/documentation/AVFAudio/AVAudioFormat/init(streamDescription:channelLayout:))

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

[`-  initWithFormatDescription:`](/documentation/AVFAudio/AVAudioFormat/init(formatDescription:))

[`-  initWithCMAudioFormatDescription:`](/documentation/AVFAudio/AVAudioFormat/init(cmAudioFormatDescription:)-8rdfj)

Creates an audio format instance from a Core Media audio format description.

### Getting the Audio Stream Description

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

The audio format properties of a stream of audio data.

### Comparing Instances

[`-  isEqual:`](/documentation/AVFAudio/AVAudioFormat/isEqual(_:))

Indicates whether the audio format instance and a specified object are functionally equivalent.

### Getting Audio Format Values

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

The audio format sampling rate, in hertz.

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

The number of channels of audio data.

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

The underlying audio channel layout.

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

The audio format description to use with Core Media APIs.

### Determining the Audio Format

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

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

[`standard`](/documentation/AVFAudio/AVAudioFormat/isStandard)

A Boolean value that indicates whether the format is in a deinterleaved native-endian float state.

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

The common format identifier instance.

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

A dictionary that represents the format as a dictionary using audio setting keys.

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

An object that contains metadata that encoders and decoders require.

### Constants

[`AVAudioCommonFormat`](/documentation/AVFAudio/AVAudioCommonFormat)

The format options that describe common audio formats.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CVarArg`](/documentation/Swift/CVarArg)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)