This document describes how to use Audio Queue Services, a C programming interface in Core Audio’s Audio Toolbox framework.
What Is Audio Queue Services?
Who Should Read This Guide?
Organization of This Document
See Also
Audio Queue Services provides a straightforward, low overhead way to record and play audio in Mac OS X. Starting with Mac OS X v10.5, it is the recommended technology to use for adding basic recording or playback features to your Mac OS X application.
Audio Queue Services lets you record and play audio in any of the following formats:
Linear PCM.
Any compressed format supported natively in Mac OS X, such as AIFC, Apple Lossless, and AAC. You can also use Audio Queue Services for MP3 playback.
Any other format for which a user has an installed codec.
Audio Queue Services is high level. It lets your application use hardware recording and playback devices (such as microphones and loudspeakers) without knowledge of the hardware interface. It also lets you use sophisticated codecs without knowledge of how the codecs work.
At the same time, Audio Queue Services supports some advanced features. It provides fine-grained timing control to support scheduled playback and synchronization. You can use it to synchronize playback of multiple audio queues and to synchronize audio with video.
Note: Audio Queue Services provides features similar to those previously provided by the Sound Manager and adds additional features such as synchronization. The Sound Manager is deprecated in Mac OS X v10.5 and does not work with 64-bit applications. Apple recommends Audio Queue Services for all new development and as a replacement for the Sound Manager in existing applications.
Audio Queue Services is a pure C interface that you can use in Cocoa and Carbon applications, as well as in Mac OS X command-line tools. To help keep the focus on Audio Queue Services, the code examples in this document are sometimes simplified by using C++ classes from the Core Audio SDK. However, neither the SDK nor the C++ language is necessary to use Audio Queue Services.
Audio Queue Services Programming Guide is useful to all Mac OS X developers who want a streamlined, straightforward way to record or play audio. To get the most from this document, you should be familiar with:
The C programming language
Using Xcode to build Mac OS X applications
The terminology described in Core Audio Glossary
This guide contains the following chapters:
“About Audio Queues” describes the capabilities, architecture, and internal workings of audio queues in Mac OS X.
“Recording Audio” describes how to record audio.
“Playing Audio” describes how to play audio.
You may find the following documents helpful:
The companion document Audio Queue Services Reference provides descriptions of the functions, callbacks, constants, and data types in Audio Queue Services.
Core Audio Data Types Reference describes data types essential for using Audio Queue Services.
Core Audio Overview provides a summary of the Core Audio frameworks, and includes an appendix on Supported Audio File and Data Formats.
Core Audio Glossary defines key terms used in the Core Audio documentation.
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-10-31)