<!--
{
  "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" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioUnit/instantiate(with:options:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioUnit(cm)instantiateWithComponentDescription:options:completionHandler:"
  },
  "title" : "instantiate(with:options:completionHandler:)"
}
-->

# instantiate(with:options:completionHandler:)

Creates an instance of an audio unit component asynchronously and wraps it in an audio unit class.

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

## Parameters

`audioComponentDescription`

The component to create.

`options`

The options the method uses to create the component.

`completionHandler`

A handler the framework calls in an arbitrary thread context when creation completes. Retain the [`AVAudioUnit`](/documentation/AVFAudio/AVAudioUnit) this handler provides.

## Discussion

You must create components with flags that include <doc://com.apple.documentation/documentation/AudioToolbox/AudioComponentFlags/requiresAsyncInstantiation> asynchronously through this method if they’re for use with [`AVAudioEngine`](/documentation/AVFAudio/AVAudioEngine).

The [`AVAudioUnit`](/documentation/AVFAudio/AVAudioUnit) instance is usually a subclass that the method selects according to the components type. For example, [`AVAudioUnitEffect`](/documentation/AVFAudio/AVAudioUnitEffect), [`AVAudioUnitGenerator`](/documentation/AVFAudio/AVAudioUnitGenerator), [`AVAudioUnitMIDIInstrument`](/documentation/AVFAudio/AVAudioUnitMIDIInstrument), or [`AVAudioUnitTimeEffect`](/documentation/AVFAudio/AVAudioUnitTimeEffect).

---

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)