<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioEngine/connectNode(_:to:fromBus:format:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioEngine(im)connect:toConnectionPoints:fromBus:format:error:"
  },
  "title" : "connectNode(_:to:fromBus:format:)"
}
-->

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

```
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

\abstract 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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)