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


class AVAudioNode : NSObject


AVAudioEngine objects contain instances of various AVAudioNode subclasses. This base class provides certain common functionality.

Nodes have input and output busses, which can be thought of as connection points. For example, an effect typically has one input bus and one output bus. A mixer typically has multiple input busses and one output bus.

Busses have formats, expressed in terms of sample rate and channel count. When making connections between nodes, often the format must match exactly. However, there are exceptions such as the AVAudioMixerNode and AVAudioOutputNode classes.

Nodes do not currently provide useful functionality until attached to an engine.


Configuring an Input Format Bus

func inputFormat(forBus: AVAudioNodeBus) -> AVAudioFormat

Returns the input format for the specified bus.

func name(forInputBus: AVAudioNodeBus) -> String?

Returns the name of an input bus.

var numberOfInputs: Int

The number of input busses for the node.

Creating and Output Format Bus

func outputFormat(forBus: AVAudioNodeBus) -> AVAudioFormat

Returns the output format for the specified bus.

func name(forOutputBus: AVAudioNodeBus) -> String?

Returns the name of the output bus.

var numberOfOutputs: Int

The number of output busses for the node.

Installing and Removing An Audio Tap

func installTap(onBus: AVAudioNodeBus, bufferSize: AVAudioFrameCount, format: AVAudioFormat?, block: AVAudioNodeTapBlock)

Installs an audio tap on the bus to record, monitor, and observe the output of the node.

func removeTap(onBus: AVAudioNodeBus)

Removes an audio tap on a bus.

Getting the Audio Engine for the Node

var engine: AVAudioEngine?

The audio engine of the node.

Getting the Latest Node Render Time

var lastRenderTime: AVAudioTime?

The time for which the node most recently rendered.

Getting Audio Node Properties

var auAudioUnit: AUAudioUnit

An AUAudioUnit object wrapping or underlying the implementation's AudioUnit instance.

var latency: TimeInterval

The processing latency of the node, in seconds.

var outputPresentationLatency: TimeInterval

The maximum render pipeline latency downstream of the node, in seconds.

Resetting the Audio Node

func reset()

Clear a unit's previous processing state.


typealias AVAudioNodeTapBlock

The block that receives copies of the output of an AVAudioNode.

typealias AVAudioNodeBus

The index of a bus on an AVAudioNode.


Inherits From

Conforms To

See Also

Multitrack Playback and Recording

Audio Engine Building Blocks

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

Using Voice Processing

Add voice processing capabilities to your app by using AVAudioEngine.

Building a Signal Generator

Use AVAudioSourceNode and a custom render callback to generate audio signals.

Performing Offline Audio Processing

Add offline audio processing features to your app by enabling offline manual rendering mode.

class AVAudioEngine

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

class 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.