<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioConverter",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioConverter"
  },
  "title" : "AVAudioConverter"
}
-->

# AVAudioConverter

An object that converts streams of audio between formats.

```
class AVAudioConverter
```

## Overview

The audio converter class transforms audio between file formats and audio encodings.

Supported transformations include:

- PCM float, integer, or bit depth conversions
- PCM sample rate conversion
- PCM interleaving and deinterleaving
- Encoding PCM to compressed formats
- Decoding compressed formats to PCM

A single audio converter instance may perform more than one of the above transformations.

## Topics

### Creating an audio converter

[`init?(from: AVAudioFormat, to: AVAudioFormat)`](/documentation/AVFAudio/AVAudioConverter/init(from:to:))

Creates an audio converter object from the specified input and output formats.

### Converting audio formats

[`func convert(to: AVAudioBuffer, error: NSErrorPointer, withInputFrom: (AVAudioPacketCount, UnsafeMutablePointer<AVAudioConverterInputStatus>) -> AVAudioBuffer?) -> AVAudioConverterOutputStatus`](/documentation/AVFAudio/AVAudioConverter/convert(to:error:withInputFrom:))

Performs a conversion between audio formats, if the system supports it.

[`typealias AVAudioConverterInputBlock`](/documentation/AVFAudio/AVAudioConverterInputBlock)

A block to get input data for conversion, as necessary.

[`func convert(to: AVAudioPCMBuffer, from: AVAudioPCMBuffer) throws`](/documentation/AVFAudio/AVAudioConverter/convert(to:from:))

Performs a basic conversion between audio formats that doesn’t involve converting codecs or sample rates.

[`enum AVAudioConverterInputStatus`](/documentation/AVFAudio/AVAudioConverterInputStatus)

An option that indicates the status of an audio converter input block.

[`enum AVAudioConverterOutputStatus`](/documentation/AVFAudio/AVAudioConverterOutputStatus)

An option that indicates the return status of an audio converter method.

### Resetting an audio converter

[`func reset()`](/documentation/AVFAudio/AVAudioConverter/reset())

Resets the converter so you can convert a new audio stream.

### Getting audio converter properties

[`var channelMap: [NSNumber]`](/documentation/AVFAudio/AVAudioConverter/channelMap)

An array of integers that indicates which input to derive each output from.

[`var dither: Bool`](/documentation/AVFAudio/AVAudioConverter/dither)

A Boolean value that indicates whether dither is on.

[`var downmix: Bool`](/documentation/AVFAudio/AVAudioConverter/downmix)

A Boolean value that indicates whether the framework mixes the channels instead of remapping.

[`var inputFormat: AVAudioFormat`](/documentation/AVFAudio/AVAudioConverter/inputFormat)

The format of the input audio stream.

[`var outputFormat: AVAudioFormat`](/documentation/AVFAudio/AVAudioConverter/outputFormat)

The format of the output audio stream.

[`var magicCookie: Data?`](/documentation/AVFAudio/AVAudioConverter/magicCookie)

An object that contains metadata for encoders and decoders.

[`var maximumOutputPacketSize: Int`](/documentation/AVFAudio/AVAudioConverter/maximumOutputPacketSize)

The maximum size of an output packet, in bytes.

### Getting bit rate properties

[`var applicableEncodeBitRates: [NSNumber]?`](/documentation/AVFAudio/AVAudioConverter/applicableEncodeBitRates)

An array of bit rates the framework applies during encoding according to the current formats and settings.

[`var availableEncodeBitRates: [NSNumber]?`](/documentation/AVFAudio/AVAudioConverter/availableEncodeBitRates)

An array of all bit rates the codec provides when encoding.

[`var availableEncodeChannelLayoutTags: [NSNumber]?`](/documentation/AVFAudio/AVAudioConverter/availableEncodeChannelLayoutTags)

An array of all output channel layout tags the codec provides when encoding.

[`var bitRate: Int`](/documentation/AVFAudio/AVAudioConverter/bitRate)

The bit rate, in bits per second.

[`var bitRateStrategy: String?`](/documentation/AVFAudio/AVAudioConverter/bitRateStrategy)

A key value constant the framework uses during encoding.

### Getting sample rate properties

[`var sampleRateConverterQuality: Int`](/documentation/AVFAudio/AVAudioConverter/sampleRateConverterQuality)

A sample rate converter algorithm key value.

[`var sampleRateConverterAlgorithm: String?`](/documentation/AVFAudio/AVAudioConverter/sampleRateConverterAlgorithm)

The priming method the sample rate converter or decoder uses.

[`var applicableEncodeSampleRates: [NSNumber]?`](/documentation/AVFAudio/AVAudioConverter/applicableEncodeSampleRates)

An array of output sample rates that the converter applies according to the current formats and settings, when encoding.

[`var availableEncodeSampleRates: [NSNumber]?`](/documentation/AVFAudio/AVAudioConverter/availableEncodeSampleRates)

An array of all output sample rates the codec provides when encoding.

### Getting priming information

[`var primeInfo: AVAudioConverterPrimeInfo`](/documentation/AVFAudio/AVAudioConverter/primeInfo)

The number of priming frames the converter uses.

[`var primeMethod: AVAudioConverterPrimeMethod`](/documentation/AVFAudio/AVAudioConverter/primeMethod)

The priming method the sample rate converter or decoder uses.

[`struct AVAudioConverterPrimeInfo`](/documentation/AVFAudio/AVAudioConverterPrimeInfo)

Priming information for audio conversion.

[`enum AVAudioConverterPrimeMethod`](/documentation/AVFAudio/AVAudioConverterPrimeMethod)

Options for the prime method property.

### Managing packet dependencies

[`var audioSyncPacketFrequency: Int`](/documentation/AVFAudio/AVAudioConverter/audioSyncPacketFrequency)

[`var contentSource: AVAudioContentSource`](/documentation/AVFAudio/AVAudioConverter/contentSource)

[`enum AVAudioContentSource`](/documentation/AVFAudio/AVAudioContentSource)

[`var dynamicRangeControlConfiguration: AVAudioDynamicRangeControlConfiguration`](/documentation/AVFAudio/AVAudioConverter/dynamicRangeControlConfiguration)

[`enum AVAudioDynamicRangeControlConfiguration`](/documentation/AVFAudio/AVAudioDynamicRangeControlConfiguration)

### Initializers

[`init?(fromFormat: AVAudioFormat, toFormat: AVAudioFormat)`](/documentation/AVFAudio/AVAudioConverter/init(fromFormat:toFormat:))

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

### 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)