Audio on Mac OS X

This information comes from a presentation I gave at UNSW after returning from Apple’s WWDC 2005.

I will talk about 3 aspects of audio technologies on Mac OS X Tiger (10.x).

QuickTime Audio

new in Tiger

  • movie audio extraction API
  • multithreading support (see tech note tn2125 on Apple Developer Connection)
  • multichannel routing layouts (sticky to multichannel once set)
  • channel labelling and properties are available in both movies and per track (eg gain, mute, balance)
  • uses audio context which plays through Core Audio (but not mpeg or streaming) so Audio Units are supported
    • eg pitch-preserving varispeed is available
    • also format conversion
  • high-resolution (192kHz, 32 floating point) multichannel (tested to 24 channels, but theoretically only hardware-limited)
  • above available to all QTKit applications (eg QuickTime Player Pro)

capture

  • multichannel capture supported with all of above including on-the-fly audio conversions (rate, format, etc)

OpenAL

From WWDC session 205 - 3D Environmental Audio with OpenAL

  • open source, cross platform, 2D or 3D positional audio API
  • API and part of Apple’s implementation is LGPLed - see /Library/Documentation/Acknowledgements.rtf
  • not just for games (eg Blender3D)
  • same coordinate system as OpenGL
  • support built into Tiger for stereo, 5.0, binaural (3d for headphones using HRTFs)
  • Apple have made an OpenAL Example demo application source code available at Apple Developer Connection
  • Tiger uses 3DMixer Audio Unit for it’s OpenAL implementation (first available in Quicktime 6.5.1)
  • OpenAL 1.1 will roll in capture APIs for feeding live audio through OpenAL (these were previously extensions available via only a patch)

Audio Units development

  • an Audio Unit is a .component package (available since OS X 10.2)
  • API is now at version 2.0
  • three Audio Unit Effect Templates are available from ADC
    • AU Effect without custom view (GUI)
    • Cocoa view
    • Carbon view
  • see instructions elsewhere on this site for using these templates
  • AU effects subclass AUEffectBase
  • NxN effects also subclass AUKernelBase
  • functions include
    • setParameter
    • getPresets
    • newFactoryPreset
  • tools to use:
    • AUVal
    • AULab
    • GarageBand
  • don’t forget to register your manufacturer / creator code