instantiate(with:options:completionHandler:)
Asynchronously creates an audio unit instance.
Declaration
class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = [], completionHandler: @escaping @Sendable (AUAudioUnit?, (any Error)?) -> Void)class func instantiate(with componentDescription: AudioComponentDescription, options: AudioComponentInstantiationOptions = []) async throws -> AUAudioUnitParameters
- 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
nilif it failed.- error
An error if the operation failed, or
nilif it succeeded.
Discussion
Certain types of audio units must be instantiated asynchronously, such as version 3 units with a view.