Class

AVAudioConverter

A class that converts streams of audio between various formats.

Declaration

class AVAudioConverter : NSObject

Topics

Creating an Audio Converter

init?(from: AVAudioFormat, to: AVAudioFormat)

Initializes an audio converter from input and output formats.

Converting Audio Formats

Resetting an Audio Converter

func reset()

Resets the converter so that a new stream can be converted.

Getting Audio Converter Properties

var channelMap: [NSNumber]

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

var dither: Bool

A Boolean value that indicates whether dither is on.

var downmix: Bool

A Boolean value that indicates whether the channels will be mixed instead of remapped.

var inputFormat: AVAudioFormat

The format of the input audio stream.

var outputFormat: AVAudioFormat

The format of the output audio stream.

var magicCookie: Data?

An object that contains metadata required by encoders and decoders.

var maximumOutputPacketSize: Int

The maximum size of an output packet, in bytes.

Getting Bit Rate Properties

var applicableEncodeBitRates: [NSNumber]?

When encoding, an array of bit rates that can be applied based on the current formats and settings.

var availableEncodeBitRates: [NSNumber]?

When encoding, an array of all bit rates provided by the codec.

var availableEncodeChannelLayoutTags: [NSNumber]?

When encoding, an array of all output channel layout tags provided by the codec.

var bitRate: Int

The bit rate, in bits per second.

var bitRateStrategy: String?

An AVEncoderBitRateStrategyKey value constant used during encoding.

Getting Sample Rate Properties

var sampleRateConverterQuality: Int

An AVSampleRateConverterAlgorithmKey value.

var sampleRateConverterAlgorithm: String?

The priming method to be used by the sample rate converter or decoder.

var applicableEncodeSampleRates: [NSNumber]?

When encoding, an array of output sample rates that can be applied based on the current formats and settings.

var availableEncodeSampleRates: [NSNumber]?

When encoding, an array of all output sample rates provided by the codec.

Getting Priming Information

var primeInfo: AVAudioConverterPrimeInfo

The number of priming frames.

var primeMethod: AVAudioConverterPrimeMethod

The priming method to be used by the sample rate converter or decoder.

struct AVAudioConverterPrimeInfo

Priming information for audio conversion.

Constants

enum AVAudioConverterInputStatus

Status codes returned by AVAudioConverterInputBlock.

enum AVAudioConverterOutputStatus

Status codes returned by convert(to:error:withInputFrom:).

enum AVAudioConverterPrimeMethod

Values for the primeMethod property.

Relationships

Inherits From

Conforms To

See Also

Audio Helpers

typealias AVAudioConverterInputBlock

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

class AVAudioUnitComponent

A class that provides details about an audio unit such as: type, subtype, manufacturer, and location.

class AVAudioUnitComponentManager

An object that provides a way to search and query audio components that are registered with the system.