As part of Apple’s poorly documented information on Audio Units and Remote I/O, there are some subtle issues that cause RENDER CALLBACKS to not work properly.
Make sure not to set any “callbacks” until after Remote I/O unit is fully initialized (i.e. after calling AudioUnitInitialize)
An audio unit’s general opeartions are:
Open an audio unit (AudioComponentInstanceNew)
Configure it based on the context – AudioUnitSetProperty
Initialise the audio unit (AudioUnitInitialize)
– at this point the audio unit is in a state where it can render audio
Render audio (AudioUnitRender)An important part of a render operation for an audio unit is to manipulate the various controls that the unit provides
to change the render effects; for instance to change the decay time of a reverb, the cut off frequency of a filter, etc.
These are called parameters, and AudioUnitGetParameter and AudioUnitSetParameter are used to interact with these.If any reconfiguration of the audio unit is required, then:
uninitialise (AudioUnitUninitialise)
Configure it based on the context – AudioUnitSetProperty
Initialise the audio unit (AudioUnitInitialize)Once the host is finished with an audio unit, it closes it:
Dispose audio unit (AudioComponentInstanceDispose)Audio units can be used programmatically (for instance a mixers could be used to render audio for a game, a generator
to play audio files, etc), or they can be hosted in Digital Audio Workstation (DAW) applications such as Logic, Garage Band.
In the DAW case, it is common for an audio unit to provide a custom view to allow the user to interact with what can be
complex DSP opearations that the audio unit performs. The view is retrieved from an audio unit through AudioUnitGetProperty
and then the host instantiates it (see <AudioUnit/AUCocoaUIView.h>)