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

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

Establishes a connection between a source node and multiple destination nodes.

## Declaration

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

## Parameters

- `sourceNode`: The source node.
- `destNodes`: An array of doc://com.apple.avfaudio/documentation/AVFAudio/AVAudioConnectionPoint objects that specify destination nodes and busses.
- `sourceBus`: The output bus on the source node.
- `format`: If not NULL, the framework uses this value for the format of the source audio node’s output bus. In all cases, the framework matches the format of the destination audio node’s input bus to the source audio node’s output bus.

## Discussion

Discussion Connections that use this method are either one-to-one or one-to-many.

## See Also

### Using Connection Points

- [AVAudioConnectionPoint](avfaudio/avaudioconnectionpoint.md)
- [inputConnectionPoint(for:inputBus:)](avfaudio/avaudioengine/inputconnectionpoint(for:inputbus:).md)
- [outputConnectionPoints(for:outputBus:)](avfaudio/avaudioengine/outputconnectionpoints(for:outputbus:).md)
