Core Audio

Core Audio is an umbrella term used to describe the collective audio support under Mac OS X and iOS. This support consists of a number of frameworks, including the CoreAudio.Framework itself. The audio architecture is shown in Figure 12-2.

images

Figure 12-2. Mac OS X and iOS audio architecture

The core of the architecture is implemented in the Audio HAL (hardware abstraction layer), which acts as an intermediary between the frameworks, applications, and the audio hardware and driver. The current architecture exists to address a number of limitations with the previous audio architecture found in Mac OS 9. In OS 9, an application using an audio device wrote directly into the driver's double-buffered sample buffer. As a consequence, OS 9 could only handle audio output from a single application at a time. Furthermore, because of the direct access, the application had to write audio in a format supported by the audio device, which limited it to only support mono or stereo 16-bit PCM samples.

Under OS X and iOS, this limitation is removed. Instead of having an application talk directly to the driver, it instead interfaces with the Audio HAL. Core Audio takes care of combining audio from multiple applications and threads into a single buffer. Each application is free to choose any audio format supported by the HAL. The HAL will convert the audio buffer into 32-bit floating-point samples before handing the buffer to the driver. The driver is then responsible for converting the buffer from floating-point format to the native format supported by the audio hardware. The same is also the case for audio input. The driver is expected to convert incoming audio into 32-bit floating samples before the audio can be transferred back to the HAL. 32-bit floating-point format is used as it has a very high dynamic range, which ensures that precision will not be lost during conversion to or from another format.

While the Core Audio framework itself provides low-level access to audio drivers, Core Audio as the collective audio architecture provides numerous other frameworks built on top of it, such as follows:

  • Audio Toolbox framework provides a diverse set of APIs for tasks such as audio clock synchronization, reading and writing of audio files, APIs for music playback, Audio conversion API, Audio graph API, and much more.
  • Audio Units framework provides support for writing filters, such as equalizers and band-pass filters.
  • Core Audio Kit framework allows the creation of Cocoa GUIs for Audio Units.
  • Core MIDI / MIDI Server framework contains APIs for working MIDI.
  • OpenAL is the Mac OS X implementation of the Open Audio Library.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.206.116