xref: /aosp_15_r20/external/webrtc/modules/audio_processing/g3doc/audio_processing_module.md (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1# Audio Processing Module (APM)
2
3<?% config.freshness.owner = 'peah' %?>
4<?% config.freshness.reviewed = '2021-04-13' %?>
5
6## Overview
7
8The APM is responsible for applying speech enhancements effects to the
9microphone signal. These effects are required for VoIP calling and some
10examples include echo cancellation (AEC), noise suppression (NS) and
11automatic gain control (AGC).
12
13The API for APM resides in [`/modules/audio_processing/include`][https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_processing/include].
14APM is created using the [`AudioProcessingBuilder`][https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_processing/include/audio_processing.h]
15builder that allows it to be customized and configured.
16
17Some specific aspects of APM include that:
18*  APM is fully thread-safe in that it can be accessed concurrently from
19   different threads.
20*  APM handles for any input sample rates < 384 kHz and achieves this by
21   automatic reconfiguration whenever a new sample format is observed.
22*  APM handles any number of microphone channels and loudspeaker channels, with
23   the same automatic reconfiguration as for the sample rates.
24
25
26APM can either be used as part of the WebRTC native pipeline, or standalone.
27