<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/AUAudioUnit/instantiate(with:options:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "c:objc(cs)AUAudioUnit(cm)instantiateWithComponentDescription:options:completionHandler:"
  },
  "title" : "instantiate(with:options:completionHandler:)"
}
-->

# instantiate(with:options:completionHandler:)

Asynchronously creates an audio unit instance.

```
class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = [], completionHandler: @escaping @Sendable (AUAudioUnit?, (any Error)?) -> Void)
```

## Parameters

`componentDescription`

The component to instantiate.

`options`

Options for loading the unit in-process or out-of-process.

`completionHandler`

The block called when instantiation has completed. The block parameters are defined as follows:

- audioUnit: An initialized audio unit if the operation succeeded, or `nil` if it failed.
- error: An error if the operation failed, or `nil` if it succeeded.

## Discussion

Certain types of audio units must be instantiated asynchronously, such as version 3 units with a view.

> Note:
> Do not block the main thread while waiting for the completion handler to be called; this can deadlock.

---

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)