---
title: "connectNode(_:to:fromBus:format:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avaudioengine/connectnode(_:to:frombus:format:)"
---

# connectNode(_:to:fromBus:format:)

## Declaration

```swift
func connectNode(_ sourceNode: AVAudioNode, to destNodes: [AVAudioConnectionPoint], fromBus sourceBus: AVAudioNodeBus, format: AVAudioFormat?) throws
```

## Parameters

- `sourceNode`: The source node
- `destNodes`: An array of AVAudioConnectionPoint objects specifying destination nodes and busses
- `sourceBus`: The output bus on source node
- `format`: If non-nil, the format of the source node’s output bus is set to this format. In all cases, the format of the destination nodes’ input bus is set to match that of the source node’s output bus

## Discussion

Discussion Establish connections between a source node and multiple destination nodes. Use this method to establish connections from a source node to multiple destination nodes. Connections made using this method are either one-to-one (when a single destination connection is specified) or one-to-many (when multiple connections are specified), but never many-to-one. To incrementally add a new connection to a source node, use this method with an array of AVAudioConnectionPoint objects comprising of pre-existing connections (obtained from outputConnectionPointsForNode:outputBus:) and the new connection. Note that any pre-existing connection involving the destination’s input bus will be broken. And, any pre-existing connection on source node which is not a part of the specified destination connection array will also be broken. Also note that when the output of a node is split into multiple paths, all the paths must render at the same rate until they reach a common mixer. In other words, starting from the split node until the common mixer node where all split paths terminate, you cannot have: any AVAudioUnitTimeEffect any sample rate conversion

## See Also

### Connecting and Disconnecting Audio Nodes

- [connectNode(_:to:format:)](avfaudio/avaudioengine/connectnode(_:to:format:).md)
- [connectNode(_:to:fromBus:toBus:format:)](avfaudio/avaudioengine/connectnode(_:to:frombus:tobus:format:).md)
- [connect(_:to:format:)](avfaudio/avaudioengine/connect(_:to:format:).md)
- [connect(_:to:fromBus:toBus:format:)](avfaudio/avaudioengine/connect(_:to:frombus:tobus:format:).md)
- [disconnectNodeInput(_:)](avfaudio/avaudioengine/disconnectnodeinput(_:).md)
- [disconnectNodeInput(_:bus:)](avfaudio/avaudioengine/disconnectnodeinput(_:bus:).md)
- [disconnectNodeOutput(_:)](avfaudio/avaudioengine/disconnectnodeoutput(_:).md)
- [disconnectNodeOutput(_:bus:)](avfaudio/avaudioengine/disconnectnodeoutput(_:bus:).md)
