connect(_:to:fromBus:toBus:format:)
Establishes a connection between two nodes, specifying the input and output busses.
Declaration
func connect(_ node1: AVAudioNode, to node2: AVAudioNode, fromBus bus1: AVAudioNodeBus, toBus bus2: AVAudioNodeBus, format: AVAudioFormat?)Parameters
- node1:
The source audio node.
- node2:
The destination audio node.
- bus1:
The output bus of the source audio node.
- bus2:
The input bus of the destination audio node.
- format:
If not
NULL, the engine uses this value for the format of the source audio node’s output bus. In all cases, the engine matches the format of the destination audio node’s input bus to the source audio node’s output bus.
Discussion
Audio nodes have input and output busses (AVAudioNodeBus). Use this method to establish connections between audio nodes. Connections are always one-to-one, never one-to-many or many-to-one.