AUAudioUnit
A class that defines a host’s interface to an audio unit.
Declaration
class AUAudioUnitMentioned in
Overview
Hosts can instantiate either version 3 or version 2 audio units with this class, and to some extent control whether an audio unit is instantiated in-process or in a separate extension process.
Version 3 audio units should subclass the AUAudioUnit class. Version 3 audio unit components can be registered in the following ways:
Package the component into an app extension containing an
AudioComponentsInfo.plistentry. The principal class must conform to the AUAudioUnitFactory protocol, which will typically instantiate an AUAudioUnit subclass.Call the registerSubclass(_:as:name:version:) method to associate a component description with an AUAudioUnit subclass. Use the convention
<manufacturer name>:<audio unit name>when naming your audio unit component.
Version 2 audio units should subclass the AUAudioUnitV2Bridge class instead. Version 2 audio unit components can be registered in the following ways:
Package the component into a component bundle containing an
AudioComponentsInfo.plistentry, referring to anAudioComponentFactoryFunctionfunction.Call the
AudioComponentRegisterfunction to associate a component description with anAudioComponentFactoryFunctionfunction.
A host does not need to be aware of the concrete AUAudioUnit subclass that is being instantiated. The init(componentDescription:options:) method ensures that the proper subclass is used.
Topics
Creating an Audio Unit
init(componentDescription:)init(componentDescription:options:)instantiate(with:options:completionHandler:)
Returning the Audio Busses
Customizing the Audio Unit Behavior
registerSubclass(_:as:name:version:)shouldChange(to:for:)setRenderResourcesAllocated(_:)internalRenderBlockmidiOutputBufferSizeHintAUInternalRenderBlock
Querying Parameters
Providing Data to the Host
musicalContextBlocktransportStateBlockcontextNamesupportsMPEAUHostMusicalContextBlockAUHostTransportStateBlock
Managing MIDI Events
isMusicDeviceOrEffectvirtualMIDICableCountscheduleMIDIEventBlockmidiOutputEventBlockmidiOutputNamesAUScheduleMIDIEventBlockAUMIDIOutputEventBlock
Managing Presets
fullStatefullStateForDocumentfactoryPresetscurrentPresetsupportsUserPresetsuserPresetssaveUserPreset(_:)deleteUserPreset(_:)presetState(for:)
Managing the Render Cycle
allocateRenderResources()deallocateRenderResources()reset()renderResourcesAllocatedrenderBlockscheduleParameterBlockmaximumFramesToRendertoken(byAddingRenderObserver:)removeRenderObserver(_:)AURenderObserver
Messaging Channels
Optimizing Performance
Describing the Audio Unit
componentDescriptioncomponentcomponentNamecomponentVersionaudioUnitNameaudioUnitShortNamemanufacturerName
Configuring the Channel Capabilities
channelCapabilitieschannelMapprofileState(forCable:channel:)enable(_:cable:onChannel:)disableProfile(_:cable:onChannel:)profileChangedBlock
Configuring the Device
deviceIDsetDeviceID(_:)canPerformInputcanPerformOutputisInputEnabledisOutputEnabledinputHandleroutputProviderdeviceInputLatencydeviceOutputLatencystartHardware()stopHardware()AURenderPullInputBlock
Configuring the User Interface
Getting the Runtime Behavior
Constants
AUEventSampleTimeAUAudioUnitBusTypeAUHostTransportStateFlagsAURenderEventTypeAURenderBlockAUInputHandler
Getting the Audio Unit Presets
kAUPresetNumberKeykAUPresetCPULoadKeykAUPresetDataKeykAUPresetElementNameKeykAUPresetExternalFileRefskAUPresetMASDataKeykAUPresetManufacturerKeykAUPresetNameKeykAUPresetPartKeykAUPresetRenderQualityKeykAUPresetSubtypeKeykAUPresetTypeKeykAUPresetVSTDataKeykAUPresetVSTPresetKeykAUPresetVersionKey
Instance properties
audioUnitMIDIProtocolhostMIDIProtocolmidiOutputEventListBlockmigrateFromPluginscheduleMIDIEventListBlock
Instance Methods
Instance Properties
See Also
Audio Units
Creating an audio unit extensionCreating custom audio effectsIncorporating Audio Effects and InstrumentsDebugging Out-of-Process Audio Units on Apple SiliconAUAudioUnitBusAUAudioUnitBusArrayAUAudioUnitPresetAUAudioUnitV2BridgeAudioUnitExtensionCopyComponentList(_:)AudioUnitExtensionSetComponentList(_:_:)AUAudioUnitFactory