Class

AVAudioEngine

A group of connected audio node objects used to generate and process audio signals and perform audio input and output.

Declaration

@interface AVAudioEngine : NSObject

Overview

You create each audio node separately and attach it to the audio engine. You can perform all operations on audio nodes during runtime—connecting them, disconnecting them, and removing them—with only minor limitations:

  • Reconnect audio nodes only when they're upstream of a mixer.

  • If you remove an audio node that has differing input and output channel counts, or that is a mixer, the result is likely to be a broken graph.

Topics

Creating an Audio Engine Instance

- init

Initializes a newly allocated audio engine.

Attaching and Detaching Audio Nodes

- attachNode:

Attaches a new audio node to the audio engine.

- detachNode:

Detaches an audio node previously attached to the audio engine.

Getting the Input, Output, and Main Mixer Nodes

inputNode

The audio engine’s singleton input audio node.

outputNode

The audio engine’s singleton output audio node.

mainMixerNode

The audio engine’s optional singleton main mixer node.

Connecting and Disconnecting Audio Nodes

- connect:to:format:

Establishes a connection between two audio nodes.

- connect:to:fromBus:toBus:format:

Establish a connection between two audio nodes, specifying the input and output busses.

- disconnectNodeInput:

Removes all input connections of the audio node.

- disconnectNodeInput:bus:

Removes the input connection of an audio node on the specified bus.

- disconnectNodeOutput:

Remove all output connections of an audio node.

- disconnectNodeOutput:bus:

Remove the output connection of an audio node on the specified bus.

Playing Audio

musicSequence

The music sequence that was previously attached to the audio engine.

- prepare

Prepares the audio engine for starting.

- startAndReturnError:

Starts the audio engine.

running

A Boolean value that indicates whether the audio engine is running.

- pause

Pauses the audio engine.

- stop

Stops the audio engine and releases any previously prepared resources.

- reset

Resets all of the audio nodes in the audio engine.

Manually Rendering an Audio Engine

- enableManualRenderingMode:format:maximumFrameCount:error:

Sets the engine to operate in manual rendering mode with the specified render format and maximum frame count.

- disableManualRenderingMode

Sets the engine to render to or from an audio device.

- renderOffline:toBuffer:error:

Makes a render call to the engine operating in the offline manual rendering mode.

Getting Manual Rendering Properties

AVAudioEngineManualRenderingBlock

A block to render the engine when operating in manual rendering mode.

manualRenderingBlock

A block to render the engine when operating in manual rendering mode.

manualRenderingFormat

The render format of the engine in manual rendering mode.

manualRenderingMaximumFrameCount

The maximum number of PCM sample frames the engine can produce in any single render call in manual rendering mode.

manualRenderingMode

The manual rendering mode configured on the engine.

manualRenderingSampleTime

An indication of where the engine is on its render timeline in manual rendering mode.

autoShutdownEnabled

A Boolean value that indicates when autoshutdown is enabled.

isInManualRenderingMode

A Boolean value that indicates whether the engine is operating in manual rendering mode.

Using Connection Points

AVAudioConnectionPoint

A representation of either a source or destination connection point in the audio engine.

- connect:toConnectionPoints:fromBus:format:

Establish connections between a source node and multiple destination nodes.

Notifications

AVAudioEngineConfigurationChangeNotification

A notification posted when the audio engine configuration changes.

Constants

AVAudioEngineManualRenderingError

Constants that describe error codes that could be returned from manual rendering mode methods.

AVAudioEngineManualRenderingMode

The two modes for manual rendering.

AVAudioEngineManualRenderingStatus

Status codes returned from the render call to the engine operating in manual rendering mode.

Instance Properties

Relationships

Inherits From

See Also

Multitrack Playback and Recording

Audio Engine Building Blocks

Add audio input, processing, and output to an audio engine instance.

AVAudioNode

An abstract class for an audio generation, processing, or I/O block.

AVAudioUnit

A subclass of the audio node class that, depending on the type of the audio unit, processes audio either in real time or non-real time.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software