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

# connectNode(_:to:format:)

## Declaration

```swift
func connectNode(_ node1: AVAudioNode, to node2: AVAudioNode, format: AVAudioFormat?) throws
```

## Discussion

Discussion Establish a connection between two nodes This calls connect:to:fromBus:toBus:format: using bus 0 on the source node, and bus 0 on the destination node, except in the case of a destination which is a mixer, in which case the destination is the mixer’s nextAvailableInputBus.

## See Also

### Connecting and Disconnecting Audio Nodes

- [connectNode(_:to:fromBus:toBus:format:)](avfaudio/avaudioengine/connectnode(_:to:frombus:tobus:format:).md)
- [connectNode(_:to:fromBus:format:)](avfaudio/avaudioengine/connectnode(_:to:frombus: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)
