This section explains how to implement the audio Hardware Abstraction Layer
(HAL), provides details about configuring an audio policy (file formats, code
organization, pre-processing effects), and describes how to configure the shared
library (creating the Android.mk
file).
The audio HAL is composed of the following interfaces:
hardware/libhardware/include/hardware/audio.h
. Represents the
main functions of an audio device.hardware/libhardware/include/hardware/audio_effect.h
.
Represents effects that can be applied to audio such as downmixing, echo, or
noise suppression.You must implement all interfaces.
For a reference of the properties you can define, refer to the audio header files:
system/media/audio/include/system/audio.h
.system/core/include/system/audio.h
.For an example, refer to the implementation for the Galaxy Nexus at
device/samsung/tuna/audio
.
In addition to implementing the audio HAL, you must also create an audio policy configuration file that describes your audio topology and package the HAL implementation into a shared library. You can also configure pre-processing effects such as automatic gain control and noise suppression.