AVFAudio handles an app's audio through an engine, sessions, playback and recording, mixing, and processing nodes. You build a signal graph by attaching and connecting AVAudioNode instances to an AVAudioEngine, routing audio between an AVAudioInputNode, AVAudioMixerNode, AVAudioEnvironmentNode, and AVAudioOutputNode, and you move sample data with formats and buffers such as AVAudioFormat, AVAudioPCMBuffer, and AVAudioCompressedBuffer. For simpler cases, use AVAudioPlayer to play sound files, read and write audio with AVAudioFile, and convert between formats using AVAudioConverter. Mixing protocols including AVAudioMixing, AVAudioStereoMixing, and AVAudio3DMixing let you position and blend sources, including 3D spatialized output.
Audio Engine 6
Build a signal-processing graph by attaching and connecting audio nodes to an engine.
- ClAVAudioEngineiOS 8.0+@class AVAudioEngine
- ClAVAudioNodeiOS 8.0+@class AVAudioNode
- ClAVAudioConnectionPointiOS 9.0+@class AVAudioConnectionPoint
- EnAVAudioEngineManualRenderingErroriOS 11.0+@enum AVAudioEngineManualRenderingError
- EnAVAudioEngineManualRenderingStatusiOS 11.0+@enum AVAudioEngineManualRenderingStatus
- EnAVAudioEngineManualRenderingModeiOS 11.0+@enum AVAudioEngineManualRenderingMode
Input, Output, and Mixing Nodes 9
Nodes that route audio in and out of the engine and mix or generate sample data.
- ClAVAudioIONodeiOS 8.0+@class AVAudioIONode
- ClAVAudioInputNodeiOS 8.0+@class AVAudioInputNode
- ClAVAudioOutputNodeiOS 8.0+@class AVAudioOutputNode
- ClAVAudioMixerNodeiOS 8.0+@class AVAudioMixerNode
- ClAVAudioPlayerNodeiOS 8.0+@class AVAudioPlayerNode
- ClAVAudioSinkNodeiOS 13.0+@class AVAudioSinkNode
- ClAVAudioSourceNodeiOS 13.0+@class AVAudioSourceNode
- StAVAudioPlayerNodeBufferOptions@enum AVAudioPlayerNodeBufferOptions
- EnAVAudioPlayerNodeCompletionCallbackType@enum AVAudioPlayerNodeCompletionCallbackType
Spatial and Environmental Audio 15
Position and render sources in 3D space and apply environmental distance and reverb effects.
- ClAVAudioEnvironmentNodeiOS 8.0+@class AVAudioEnvironmentNode
- ClAVAudioEnvironmentDistanceAttenuationParametersiOS 8.0+@class AVAudioEnvironmentDistanceAttenuationParameters
- ClAVAudioEnvironmentReverbParametersiOS 8.0+@class AVAudioEnvironmentReverbParameters
- PrAVAudioMixingiOS 8.0+@protocol AVAudioMixing
- PrAVAudioStereoMixingiOS 8.0+@protocol AVAudioStereoMixing
- PrAVAudio3DMixing@protocol AVAudio3DMixing
- ClAVAudioMixingDestinationiOS 9.0+@class AVAudioMixingDestination
- StAVAudio3DPoint@struct AVAudio3DPoint
- StAVAudio3DVectorOrientation@struct AVAudio3DVectorOrientation
- StAVAudio3DAngularOrientation@struct AVAudio3DAngularOrientation
- EnAVAudioEnvironmentDistanceAttenuationModeliOS 8.0+@enum AVAudioEnvironmentDistanceAttenuationModel
- EnAVAudioEnvironmentOutputTypeiOS 13.0+@enum AVAudioEnvironmentOutputType
- EnAVAudio3DMixingRenderingAlgorithmiOS 8.0+@enum AVAudio3DMixingRenderingAlgorithm
- EnAVAudio3DMixingSourceModeiOS 13.0+@enum AVAudio3DMixingSourceMode
- EnAVAudio3DMixingPointSourceInHeadModeiOS 13.0+@enum AVAudio3DMixingPointSourceInHeadMode
Audio Units and Effects 16
Audio unit nodes that apply effects, generate, or process audio within the engine.
- ClAVAudioUnitiOS 8.0+@class AVAudioUnit
- ClAVAudioUnitComponentiOS 9.0+@class AVAudioUnitComponent
- ClAVAudioUnitComponentManageriOS 9.0+@class AVAudioUnitComponentManager
- ClAVAudioUnitEffectiOS 8.0+@class AVAudioUnitEffect
- ClAVAudioUnitGeneratoriOS 8.0+@class AVAudioUnitGenerator
- ClAVAudioUnitDelayiOS 8.0+@class AVAudioUnitDelay
- ClAVAudioUnitDistortioniOS 8.0+@class AVAudioUnitDistortion
- ClAVAudioUnitEQiOS 8.0+@class AVAudioUnitEQ
- ClAVAudioUnitEQFilterParametersiOS 8.0+@class AVAudioUnitEQFilterParameters
- ClAVAudioUnitReverbiOS 8.0+@class AVAudioUnitReverb
- ClAVAudioUnitTimeEffectiOS 8.0+@class AVAudioUnitTimeEffect
- ClAVAudioUnitTimePitchiOS 8.0+@class AVAudioUnitTimePitch
- ClAVAudioUnitVarispeediOS 8.0+@class AVAudioUnitVarispeed
- EnAVAudioUnitDistortionPresetiOS 8.0+Constants that specify the preset distortion settings of a distortion effect.
- EnAVAudioUnitEQFilterTypeiOS 8.0+@enum AVAudioUnitEQFilterType
- EnAVAudioUnitReverbPresetiOS 8.0+Constants that specify the preset room settings of a reverb effect.
Formats and Buffers 8
Describe audio stream formats and hold sample data in memory for processing.
- ClAVAudioFormatiOS 8.0+@class AVAudioFormat
- ClAVAudioChannelLayoutiOS 8.0+@class AVAudioChannelLayout
- ClAVAudioBufferiOS 8.0+@class AVAudioBuffer
- ClAVAudioPCMBufferiOS 8.0+@class AVAudioPCMBuffer
- ClAVAudioCompressedBufferiOS 9.0+@class AVAudioCompressedBuffer
- StAVReadOnlyAudioPCMBufferiOS 27.0+A read-only, Sendable audio buffer for safe concurrent access.
- EnAVAudioCommonFormatiOS 8.0+@enum AVAudioCommonFormat
- ClAVAudioTimeiOS 8.0+@class AVAudioTime
Files and Format Conversion 7
Read and write audio files and convert sample data between formats.
- ClAVAudioFileiOS 8.0+@class AVAudioFile
- ClAVAudioConverteriOS 9.0+@class AVAudioConverter
- StAVAudioConverterPrimeInfo@struct AVAudioConverterPrimeInfo
- EnAVAudioConverterPrimeMethod@enum AVAudioConverterPrimeMethod
- EnAVAudioConverterInputStatusiOS 9.0+@enum AVAudioConverterInputStatus
- EnAVAudioConverterOutputStatusiOS 9.0+@enum AVAudioConverterOutputStatus
- EnAVAudioContentSourceiOS 26.0+Constants that identify the source of audio content.
Playback and Recording 5
Play sound files and record audio to disk with simple, high-level objects.
- ClAVAudioPlayeriOS 2.2+An object that plays audio from a file or in-memory data.
- ClAVAudioRecorderiOS 3.0+@class AVAudioRecorder
- PrAVAudioRecorderDelegateiOS 3.0+@protocol AVAudioRecorderDelegate
- EnAVAudioQualityConstants that specify the quality level for audio encoding.
- EnAVAudioDynamicRangeControlConfigurationConstants that specify a dynamic range control configuration for audio.
MIDI Sequencing and Instruments 23
Sequence, play, and edit MIDI music tracks, events, and sampler instruments.
- ClAVAudioSequenceriOS 9.0+@class AVAudioSequencer
- ClAVMusicTrackiOS 9.0+@class AVMusicTrack
- ClAVMIDIPlayeriOS 8.0+@class AVMIDIPlayer
- ClAVAudioUnitMIDIInstrumentiOS 8.0+Base class for MIDI instruments.
- ClAVAudioUnitSampleriOS 8.0+@class AVAudioUnitSampler
- ClAVMusicEventiOS 16.0+@class AVMusicEvent
- ClAVMIDINoteEventiOS 16.0+@class AVMIDINoteEvent
- ClAVMIDIChannelEventiOS 16.0+@class AVMIDIChannelEvent
- ClAVMIDIControlChangeEventiOS 16.0+@class AVMIDIControlChangeEvent
- ClAVMIDIPolyPressureEventiOS 16.0+@class AVMIDIPolyPressureEvent
- ClAVMIDIProgramChangeEventiOS 16.0+@class AVMIDIProgramChangeEvent
- ClAVMIDIChannelPressureEventiOS 16.0+@class AVMIDIChannelPressureEvent
- ClAVMIDIPitchBendEventiOS 16.0+@class AVMIDIPitchBendEvent
- ClAVMIDISysexEventiOS 16.0+@class AVMIDISysexEvent
- ClAVMIDIMetaEventiOS 16.0+@class AVMIDIMetaEvent
- ClAVMusicUserEventiOS 16.0+@class AVMusicUserEvent
- ClAVExtendedNoteOnEventiOS 16.0+@class AVExtendedNoteOnEvent
- ClAVParameterEventiOS 16.0+@class AVParameterEvent
- ClAVAUPresetEventiOS 16.0+@class AVAUPresetEvent
- ClAVExtendedTempoEventiOS 16.0+@class AVExtendedTempoEvent
- StAVMusicSequenceLoadOptions@typedef AVMusicSequenceLoadOptions
- St_AVBeatRange@typedef AVBeatRange
- EnAVMusicTrackLoopCountiOS 8.0+Constants that specify how many times a music track loops.
Audio Session 12
Configure the app's audio behavior, routing, and capabilities with the system.
- ClAVAudioSessioniOS 3.0+An object that communicates the app's audio intent and behavior to the system.
- ClAVAudioApplicationiOS 17.0+Class containing methods that relate to an application bundle's audio (i.e. a collection of one or more AVAudioSession instances)
- PrAVAudioSessionDelegateA protocol for responding to audio session events such as interruptions and route changes.
- ClAVAudioSessionChannelDescriptioniOS 6.0+@class AVAudioSessionChannelDescription
- ClAVAudioSessionDataSourceDescriptioniOS 6.0+Information about one of potentially multiple data sources associated with a port.
- ClAVAudioSessionCapabilityiOS 26.0+Describes whether a specific capability is supported and if that capability is currently enabled
- ClAVAudioSessionPortDescriptioniOS 6.0+Information about a port, a physical connector or audio device.
- ClAVAudioSessionPortExtensionBluetoothMicrophoneiOS 26.0+An object that describes capabilities of Bluetooth microphone ports.
- ClAVAudioSessionRouteDescriptioniOS 6.0+A description of the input and output ports which comprise a route.
- PrAVAudioSessionSpatialExperiencevisionOS 1.0+A protocol that describes a spatial audio experience for an audio session.
- StAVAudioSessionActivationOptions@enum AVAudioSessionActivationOptions
- StAVAudioSessionDeactivationOptionsOptions for deactivating an AVAudioSession
Voice Processing 2
Configure voice-processing behaviors such as ducking and speech activity detection.
- StAVAudioVoiceProcessingOtherAudioDuckingConfigurationiOS 17.0+@struct AVAudioVoiceProcessingOtherAudioDuckingConfiguration
- EnAVAudioVoiceProcessingSpeechActivityEventiOS 17.0+@enum AVAudioVoiceProcessingSpeechActivityEvent
Speech Synthesis 11
Generate spoken audio from text and provide custom synthesis voices.
- ClAVSpeechSynthesizeriOS 7.0+@class AVSpeechSynthesizer
- PrAVSpeechSynthesizerDelegate@protocol AVSpeechSynthesizerDelegate
- ClAVSpeechUtteranceiOS 7.0+@class AVSpeechUtterance
- ClAVSpeechSynthesisVoiceiOS 7.0+@class AVSpeechSynthesisVoice
- ClAVSpeechSynthesisMarkeriOS 16.0+An object that marks a position within synthesized speech output.
- ClAVSpeechSynthesisProviderVoiceiOS 16.0+@brief The representation of a provided voice that is available for speech synthesis.
- ClAVSpeechSynthesisProviderRequestiOS 16.0+An @c AVSpeechSynthesisProviderRequest gets delivered to an @c AVSpeechSynthesisProviderAudioUnit in order to synthesize audio.
- ClAVSpeechSynthesisProviderAudioUnitiOS 16.0+An audio unit that a speech synthesis provider extension implements to generate speech.
- EnAVSpeechBoundaryiOS 7.0+Constants that specify whether a speech action takes effect immediately or at a word boundary.
- EnAVSpeechSynthesisVoiceQualityiOS 9.0+Constants that specify the quality level of a speech synthesis voice.
- EnAVSpeechSynthesisVoiceGenderiOS 13.0+Constants that specify the gender associated with a speech synthesis voice.
Protocols 1
- PrAVAudioPlayerDelegate
Type Aliases 21
- TyAVAudioConverterInputBlock@typedef AVAudioConverterInputBlock
- TyAVAudioEngineManualRenderingBlock@typedef AVAudioEngineManualRenderingBlock
- TyAVMIDIEventListBlock@typedef AVMIDIEventListBlock
- TyAVAudioIONodeInputBlock@typedef AVAudioIONodeInputBlock
- TyAVAudioNodeTapBlock@typedef AVAudioNodeTapBlock
- TyAVAudioPlayerNodeCompletionHandler@typedef AVAudioPlayerNodeCompletionHandler
- TyAVBeatRange@typedef AVBeatRange
- TyAVAudioSequencerUserCallback
- TyAVMusicEventEnumerationBlock@typedef AVMusicEventEnumerationBlock
- TyAVAudioSinkNodeReceiverBlock@typedef AVAudioSinkNodeReceiverBlock
- TyAVAudioSourceNodeRenderBlock@typedef AVAudioSourceNodeRenderBlock
- TyAVAudioFramePosition@typedef AVAudioFramePosition
- TyAVAudioFrameCount@typedef AVAudioFrameCount
- TyAVAudioPacketCount@typedef AVAudioPacketCount
- TyAVAudioChannelCount@typedef AVAudioChannelCount
- TyAVAudioNodeCompletionHandler@typedef AVAudioNodeCompletionHandler
Show 5 more
- TyAVAudioNodeBus@typedef AVAudioNodeBus
- TyAVMusicTimeStamp@typedef AVMusicTimeStamp
- TyAVAudio3DVector@typedef AVAudio3DVector
- TyAVMIDIPlayerCompletionHandler@typedef AVMIDIPlayerCompletionHandler
- TyAVSpeechSynthesisProviderOutputBlock@brief A block of information that is relevant to the generation of speech synthesis.