Audio Unit AUPlugIn - Updating an existing Audio Unit for OS X Lion and later
When updating audio units for Mac OS X Lion or later there are a number of changes that must be made to your Xcode project for the audio unit to build and run on the system. Once these changes are in place, the audio unit will build and run in Mac OS X Lion and also run when deployed in Mac OS X v10.6.x.
This technical note discusses these changes using the FilterDemo audio unit sample code project as an example.
Mac OS X Lion introduces a new plug-in model called
AUPlugIn which is no longer based on the Component Manager. The
AUPlugIn model has a new dispatch mechanism requiring the inclusion of two new dispatch helper files called
AUDIOCOMPONENT_ENTRY() macro has been added to
ComponentBase.h and by using this macro audio unit entry points are created for both the audio unit plug-in for Mac OS X Lion and the Component Manager component for backwards compatibility with Mac OS X v10.6.x.
Because audio units no longer use the Component Manager on Mac OS X Lion or newer,
AUPlugIn based audio units do not use resource files (
.r files) or the '
thng' resource to define properties such as
kComponentManufactureType. These properties are now specified in the project's
Info.plist file for the audio unit. You can continue to include the Component Manager resource file in the project for backwards compatibility with Mac OS X v10.6.x.
AUPlugIn entry point generated by the
AUDIOCOMPONENT_ENTRY() macro is required and must be added to the exports file (
.exp). You can leave the Component Manager entry point in the exports file to provide backwards compatibility with Mac OS X v10.6.x.
Example: Updating the FilterDemo Audio Unit
Download the FilterDemo Audio Unit sample and walk though the following update steps. Mac OS X Lion and the associated Xcode tools are required.
Open the file
Filter). This is the new macro that generates the plugin entry for the audio unit. See Listing 1.
Add the new entry point called
_FilterFactoryis generated by the
_FilterEntryfor backwards compatibility. See Listing 2.
AudioComponentsdictionary to the
Info.plistfile. Audio unit plugins do not use resource files to define their properties, therefore these items now need to be specified in the
Info.plistfile. Note that the resource file (
Filter.r) should be left in place for backwards compatibility. See Listing 3 and Figure 1.
AUPlugInDispatch.cppfiles to the project. These dispatch helper files are located in
Developer/Extras/CoreAudio/AUPublic/AUBaseand are required by the
AUPlugInmanager. See Figure 2.
Listing 1 Change entry point generation macro in
// Standard DSP AudioUnit implementation
// old component manager entry point no longer required
// new AUPlugIn macro
Listing 2 Add new entry point in
AudioComponents array in the
<string>Apple Demo: Filter</string>
Document Revision History
Fixed plist information
Fixed plist information
New document that discusses required audio unit project changes for building and running on OS X Lion (and v10.6.x).