Audio Manager Overview

The audio manager is used to control audio stream routing, volume, and ducking behavior.

About the audio manager

The audio manager and its library of functions and data structures allows client applications to set audio properties such as routing, volume, and concurrency, and to receive events notifying them of changes to these properties for audio streams for other applications.

The audio manager provides:

Applications should notify the audio manager of the types of audio streams that are opening or closing, and can link specific PCM streams with these types in order to support advanced concurrency use cases (e.g., using alerts to automatically trigger audio ducking in the media player). The application can also use the audio manager to override the default preferred routing table for an audio stream type, thus allowing the user to choose the output device (e.g., the loudspeaker rather than the wired headset).

Using the audio manager is optional. However, applications that require close integration with the audio system will need to use this service. A client application that doesn't use the audio manager will be managed as a "default" type audio stream, and the client application will have little control over this default stream.

Using the audio manager

To play audio, an application needs to open a PCM stream. After opening the PCM stream and getting a handle for the stream, the application should get an audio manager handle with the same audio type as the PCM stream. This can be done by calling audio_manager_snd_pcm_open(), then audio_manager_get_handle(); or by calling audio_manager_snd_pcm_open_name().

Audio types are defined in audio_manager_audio_type_t.