<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioEngine/attach(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioEngine(im)attachNode:"
  },
  "title" : "attach(_:)"
}
-->

# attach(_:)

Attaches an audio node to the audio engine.

```
func attach(_ node: AVAudioNode)
```

## Parameters

`node`

The audio node to attach.

## Discussion

An instance of [`AVAudioNode`](/documentation/AVFAudio/AVAudioNode) isn’t usable until you attach it to the audio engine using this method.

```swift
// Create a player node that's used for audio playback.
let playerNode = AVAudioPlayerNode()

// Attach the player node to the engine.
engine.attach(playerNode)
```

---

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)