Contents

inputNode

The audio engine’s singleton input audio node.

Declaration

var inputNode: AVAudioInputNode { get }

Discussion

The framework performs audio input through an input node. The audio engine creates a singleton on demand when first accessing this variable. To receive input, connect another node from the output of the input node, or create a recording tap on it.

When the engine renders to and from an audio device, the AVAudioSession category and the availability of hardware determines whether an app performs input (for example, input hardware isn’t available in tvOS). Check the input node’s input format (specifically, the hardware format) for a nonzero sample rate and channel count to see if input is in an enabled state.

Trying to perform input through the input node when it isn’t available or in an enabled state causes the engine to throw an error (when possible) or an exception.

In manual rendering mode, the input node can synchronously supply data to the engine while it’s rendering. For more information, see setManualRenderingInputPCMFormat(_:inputBlock:).

See Also

Getting the Input, Output, and Main Mixer Nodes