TechnologiesAudio

AVFAudio

iOSmacOStvOSwatchOSvisionOS

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.

  • Cl
    AVAudioEngineiOS 8.0+
    @class AVAudioEngine
  • Cl
    AVAudioNodeiOS 8.0+
    @class AVAudioNode
  • Cl
    AVAudioConnectionPointiOS 9.0+
    @class AVAudioConnectionPoint
  • En
    AVAudioEngineManualRenderingErroriOS 11.0+
    @enum AVAudioEngineManualRenderingError
  • En
    AVAudioEngineManualRenderingStatusiOS 11.0+
    @enum AVAudioEngineManualRenderingStatus
  • En
    AVAudioEngineManualRenderingModeiOS 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.

  • Cl
    AVAudioIONodeiOS 8.0+
    @class AVAudioIONode
  • Cl
    AVAudioInputNodeiOS 8.0+
    @class AVAudioInputNode
  • Cl
    AVAudioOutputNodeiOS 8.0+
    @class AVAudioOutputNode
  • Cl
    AVAudioMixerNodeiOS 8.0+
    @class AVAudioMixerNode
  • Cl
    AVAudioPlayerNodeiOS 8.0+
    @class AVAudioPlayerNode
  • Cl
    AVAudioSinkNodeiOS 13.0+
    @class AVAudioSinkNode
  • Cl
    AVAudioSourceNodeiOS 13.0+
    @class AVAudioSourceNode
  • St
    AVAudioPlayerNodeBufferOptions
    @enum AVAudioPlayerNodeBufferOptions
  • En
    AVAudioPlayerNodeCompletionCallbackType
    @enum AVAudioPlayerNodeCompletionCallbackType

Spatial and Environmental Audio 15

Position and render sources in 3D space and apply environmental distance and reverb effects.

  • Cl
    AVAudioEnvironmentNodeiOS 8.0+
    @class AVAudioEnvironmentNode
  • Cl
    AVAudioEnvironmentDistanceAttenuationParametersiOS 8.0+
    @class AVAudioEnvironmentDistanceAttenuationParameters
  • Cl
    AVAudioEnvironmentReverbParametersiOS 8.0+
    @class AVAudioEnvironmentReverbParameters
  • Pr
    AVAudioMixingiOS 8.0+
    @protocol AVAudioMixing
  • Pr
    AVAudioStereoMixingiOS 8.0+
    @protocol AVAudioStereoMixing
  • Pr
    AVAudio3DMixing
    @protocol AVAudio3DMixing
  • Cl
    AVAudioMixingDestinationiOS 9.0+
    @class AVAudioMixingDestination
  • St
    AVAudio3DPoint
    @struct AVAudio3DPoint
  • St
    AVAudio3DVectorOrientation
    @struct AVAudio3DVectorOrientation
  • St
    AVAudio3DAngularOrientation
    @struct AVAudio3DAngularOrientation
  • En
    AVAudioEnvironmentDistanceAttenuationModeliOS 8.0+
    @enum AVAudioEnvironmentDistanceAttenuationModel
  • En
    AVAudioEnvironmentOutputTypeiOS 13.0+
    @enum AVAudioEnvironmentOutputType
  • En
    AVAudio3DMixingRenderingAlgorithmiOS 8.0+
    @enum AVAudio3DMixingRenderingAlgorithm
  • En
    AVAudio3DMixingSourceModeiOS 13.0+
    @enum AVAudio3DMixingSourceMode
  • En
    AVAudio3DMixingPointSourceInHeadModeiOS 13.0+
    @enum AVAudio3DMixingPointSourceInHeadMode

Audio Units and Effects 16

Audio unit nodes that apply effects, generate, or process audio within the engine.

  • Cl
    AVAudioUnitiOS 8.0+
    @class AVAudioUnit
  • Cl
    AVAudioUnitComponentiOS 9.0+
    @class AVAudioUnitComponent
  • Cl
    AVAudioUnitComponentManageriOS 9.0+
    @class AVAudioUnitComponentManager
  • Cl
    AVAudioUnitEffectiOS 8.0+
    @class AVAudioUnitEffect
  • Cl
    AVAudioUnitGeneratoriOS 8.0+
    @class AVAudioUnitGenerator
  • Cl
    AVAudioUnitDelayiOS 8.0+
    @class AVAudioUnitDelay
  • Cl
    AVAudioUnitDistortioniOS 8.0+
    @class AVAudioUnitDistortion
  • Cl
    AVAudioUnitEQiOS 8.0+
    @class AVAudioUnitEQ
  • Cl
    AVAudioUnitEQFilterParametersiOS 8.0+
    @class AVAudioUnitEQFilterParameters
  • Cl
    AVAudioUnitReverbiOS 8.0+
    @class AVAudioUnitReverb
  • Cl
    AVAudioUnitTimeEffectiOS 8.0+
    @class AVAudioUnitTimeEffect
  • Cl
    AVAudioUnitTimePitchiOS 8.0+
    @class AVAudioUnitTimePitch
  • Cl
    AVAudioUnitVarispeediOS 8.0+
    @class AVAudioUnitVarispeed
  • En
    AVAudioUnitDistortionPresetiOS 8.0+
    Constants that specify the preset distortion settings of a distortion effect.
  • En
    AVAudioUnitEQFilterTypeiOS 8.0+
    @enum AVAudioUnitEQFilterType
  • En
    AVAudioUnitReverbPresetiOS 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.

  • Cl
    AVAudioFormatiOS 8.0+
    @class AVAudioFormat
  • Cl
    AVAudioChannelLayoutiOS 8.0+
    @class AVAudioChannelLayout
  • Cl
    AVAudioBufferiOS 8.0+
    @class AVAudioBuffer
  • Cl
    AVAudioPCMBufferiOS 8.0+
    @class AVAudioPCMBuffer
  • Cl
    AVAudioCompressedBufferiOS 9.0+
    @class AVAudioCompressedBuffer
  • St
    AVReadOnlyAudioPCMBufferiOS 27.0+
    A read-only, Sendable audio buffer for safe concurrent access.
  • En
    AVAudioCommonFormatiOS 8.0+
    @enum AVAudioCommonFormat
  • Cl
    AVAudioTimeiOS 8.0+
    @class AVAudioTime

Files and Format Conversion 7

Read and write audio files and convert sample data between formats.

  • Cl
    AVAudioFileiOS 8.0+
    @class AVAudioFile
  • Cl
    AVAudioConverteriOS 9.0+
    @class AVAudioConverter
  • St
    AVAudioConverterPrimeInfo
    @struct AVAudioConverterPrimeInfo
  • En
    AVAudioConverterPrimeMethod
    @enum AVAudioConverterPrimeMethod
  • En
    AVAudioConverterInputStatusiOS 9.0+
    @enum AVAudioConverterInputStatus
  • En
    AVAudioConverterOutputStatusiOS 9.0+
    @enum AVAudioConverterOutputStatus
  • En
    AVAudioContentSourceiOS 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.

  • Cl
    AVAudioPlayeriOS 2.2+
    An object that plays audio from a file or in-memory data.
  • Cl
    AVAudioRecorderiOS 3.0+
    @class AVAudioRecorder
  • Pr
    AVAudioRecorderDelegateiOS 3.0+
    @protocol AVAudioRecorderDelegate
  • En
    AVAudioQuality
    Constants that specify the quality level for audio encoding.
  • En
    AVAudioDynamicRangeControlConfiguration
    Constants 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.

  • Cl
    AVAudioSequenceriOS 9.0+
    @class AVAudioSequencer
  • Cl
    AVMusicTrackiOS 9.0+
    @class AVMusicTrack
  • Cl
    AVMIDIPlayeriOS 8.0+
    @class AVMIDIPlayer
  • Cl
    AVAudioUnitMIDIInstrumentiOS 8.0+
    Base class for MIDI instruments.
  • Cl
    AVAudioUnitSampleriOS 8.0+
    @class AVAudioUnitSampler
  • Cl
    AVMusicEventiOS 16.0+
    @class AVMusicEvent
  • Cl
    AVMIDINoteEventiOS 16.0+
    @class AVMIDINoteEvent
  • Cl
    AVMIDIChannelEventiOS 16.0+
    @class AVMIDIChannelEvent
  • Cl
    AVMIDIControlChangeEventiOS 16.0+
    @class AVMIDIControlChangeEvent
  • Cl
    AVMIDIPolyPressureEventiOS 16.0+
    @class AVMIDIPolyPressureEvent
  • Cl
    AVMIDIProgramChangeEventiOS 16.0+
    @class AVMIDIProgramChangeEvent
  • Cl
    AVMIDIChannelPressureEventiOS 16.0+
    @class AVMIDIChannelPressureEvent
  • Cl
    AVMIDIPitchBendEventiOS 16.0+
    @class AVMIDIPitchBendEvent
  • Cl
    AVMIDISysexEventiOS 16.0+
    @class AVMIDISysexEvent
  • Cl
    AVMIDIMetaEventiOS 16.0+
    @class AVMIDIMetaEvent
  • Cl
    AVMusicUserEventiOS 16.0+
    @class AVMusicUserEvent
  • Cl
    AVExtendedNoteOnEventiOS 16.0+
    @class AVExtendedNoteOnEvent
  • Cl
    AVParameterEventiOS 16.0+
    @class AVParameterEvent
  • Cl
    AVAUPresetEventiOS 16.0+
    @class AVAUPresetEvent
  • Cl
    AVExtendedTempoEventiOS 16.0+
    @class AVExtendedTempoEvent
  • St
    AVMusicSequenceLoadOptions
    @typedef AVMusicSequenceLoadOptions
  • St
    _AVBeatRange
    @typedef AVBeatRange
  • En
    AVMusicTrackLoopCountiOS 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.

  • Cl
    AVAudioSessioniOS 3.0+
    An object that communicates the app's audio intent and behavior to the system.
  • Cl
    AVAudioApplicationiOS 17.0+
    Class containing methods that relate to an application bundle's audio (i.e. a collection of one or more AVAudioSession instances)
  • Pr
    AVAudioSessionDelegate
    A protocol for responding to audio session events such as interruptions and route changes.
  • Cl
    AVAudioSessionChannelDescriptioniOS 6.0+
    @class AVAudioSessionChannelDescription
  • Cl
    AVAudioSessionDataSourceDescriptioniOS 6.0+
    Information about one of potentially multiple data sources associated with a port.
  • Cl
    AVAudioSessionCapabilityiOS 26.0+
    Describes whether a specific capability is supported and if that capability is currently enabled
  • Cl
    AVAudioSessionPortDescriptioniOS 6.0+
    Information about a port, a physical connector or audio device.
  • Cl
    AVAudioSessionPortExtensionBluetoothMicrophoneiOS 26.0+
    An object that describes capabilities of Bluetooth microphone ports.
  • Cl
    AVAudioSessionRouteDescriptioniOS 6.0+
    A description of the input and output ports which comprise a route.
  • Pr
    AVAudioSessionSpatialExperiencevisionOS 1.0+
    A protocol that describes a spatial audio experience for an audio session.
  • St
    AVAudioSessionActivationOptions
    @enum AVAudioSessionActivationOptions
  • St
    AVAudioSessionDeactivationOptions
    Options for deactivating an AVAudioSession

Voice Processing 2

Configure voice-processing behaviors such as ducking and speech activity detection.

  • St
    AVAudioVoiceProcessingOtherAudioDuckingConfigurationiOS 17.0+
    @struct AVAudioVoiceProcessingOtherAudioDuckingConfiguration
  • En
    AVAudioVoiceProcessingSpeechActivityEventiOS 17.0+
    @enum AVAudioVoiceProcessingSpeechActivityEvent

Speech Synthesis 11

Generate spoken audio from text and provide custom synthesis voices.

  • Cl
    AVSpeechSynthesizeriOS 7.0+
    @class AVSpeechSynthesizer
  • Pr
    AVSpeechSynthesizerDelegate
    @protocol AVSpeechSynthesizerDelegate
  • Cl
    AVSpeechUtteranceiOS 7.0+
    @class AVSpeechUtterance
  • Cl
    AVSpeechSynthesisVoiceiOS 7.0+
    @class AVSpeechSynthesisVoice
  • Cl
    AVSpeechSynthesisMarkeriOS 16.0+
    An object that marks a position within synthesized speech output.
  • Cl
    AVSpeechSynthesisProviderVoiceiOS 16.0+
    @brief The representation of a provided voice that is available for speech synthesis.
  • Cl
    AVSpeechSynthesisProviderRequestiOS 16.0+
    An @c AVSpeechSynthesisProviderRequest gets delivered to an @c AVSpeechSynthesisProviderAudioUnit in order to synthesize audio.
  • Cl
    AVSpeechSynthesisProviderAudioUnitiOS 16.0+
    An audio unit that a speech synthesis provider extension implements to generate speech.
  • En
    AVSpeechBoundaryiOS 7.0+
    Constants that specify whether a speech action takes effect immediately or at a word boundary.
  • En
    AVSpeechSynthesisVoiceQualityiOS 9.0+
    Constants that specify the quality level of a speech synthesis voice.
  • En
    AVSpeechSynthesisVoiceGenderiOS 13.0+
    Constants that specify the gender associated with a speech synthesis voice.

Protocols 1

  • Pr
    AVAudioPlayerDelegate

Type Aliases 21

  • Ty
    AVAudioConverterInputBlock
    @typedef AVAudioConverterInputBlock
  • Ty
    AVAudioEngineManualRenderingBlock
    @typedef AVAudioEngineManualRenderingBlock
  • Ty
    AVMIDIEventListBlock
    @typedef AVMIDIEventListBlock
  • Ty
    AVAudioIONodeInputBlock
    @typedef AVAudioIONodeInputBlock
  • Ty
    AVAudioNodeTapBlock
    @typedef AVAudioNodeTapBlock
  • Ty
    AVAudioPlayerNodeCompletionHandler
    @typedef AVAudioPlayerNodeCompletionHandler
  • Ty
    AVBeatRange
    @typedef AVBeatRange
  • Ty
    AVAudioSequencerUserCallback
  • Ty
    AVMusicEventEnumerationBlock
    @typedef AVMusicEventEnumerationBlock
  • Ty
    AVAudioSinkNodeReceiverBlock
    @typedef AVAudioSinkNodeReceiverBlock
  • Ty
    AVAudioSourceNodeRenderBlock
    @typedef AVAudioSourceNodeRenderBlock
  • Ty
    AVAudioFramePosition
    @typedef AVAudioFramePosition
  • Ty
    AVAudioFrameCount
    @typedef AVAudioFrameCount
  • Ty
    AVAudioPacketCount
    @typedef AVAudioPacketCount
  • Ty
    AVAudioChannelCount
    @typedef AVAudioChannelCount
  • Ty
    AVAudioNodeCompletionHandler
    @typedef AVAudioNodeCompletionHandler
Show 5 more
  • Ty
    AVAudioNodeBus
    @typedef AVAudioNodeBus
  • Ty
    AVMusicTimeStamp
    @typedef AVMusicTimeStamp
  • Ty
    AVAudio3DVector
    @typedef AVAudio3DVector
  • Ty
    AVMIDIPlayerCompletionHandler
    @typedef AVMIDIPlayerCompletionHandler
  • Ty
    AVSpeechSynthesisProviderOutputBlock
    @brief A block of information that is relevant to the generation of speech synthesis.

Extends 3

NSNotification__AVAudioSessionSpatialExperienceOptionNotificationCenter
← Audio