Automatic Gain Control: Stabilize Mic Levels Without Hiding Distortion
Automatic gain control (AGC) adjusts capture gain as speech gets louder or quieter. Choosing between analog, adaptive digital, and fixed gain depends on the device control path; AGC cannot restore clipped audio and may raise background noise.
Automatic gain control (AGC) changes capture gain to keep speech near a useful level as the talker gets louder, quieter, or moves relative to the microphone. It can reduce manual adjustment in calls and meetings. It cannot recover sound the microphone did not capture or repair clipping that has already occurred, and boosting a quiet signal can also raise noise.
How AGC changes a signal
Gain is a multiplier that makes a signal larger or smaller. An AGC estimates input level, compares it with a target range, then raises or lowers gain. Depending on the implementation, it may control an analog microphone input, scale digital samples, or combine gain control with compression that gradually reduces gain on louder signals.
| Mode | Where it acts | When it fits | Limitation |
|---|---|---|---|
| Adaptive analog | Device input gain plus digital compression | The app can read the current device level and apply the recommended level | The level feedback must be connected to the actual device |
| Adaptive digital | Captured sample scale and compression | Analog input control is unavailable | Cannot undo input clipping; boosting also raises noise |
| Fixed digital gain/compression | Preset gain, compression at higher levels | Capture level is predictable | May not follow large changes in speaker level or distance |
These distinctions follow the GainController1 interface in a pinned WebRTC Audio Processing Module revision. Adaptive analog mode requires passing the OS mixer's current input level to the processor and applying the recommended level back to the device. The API describes fixed digital mode for predictable capture levels on embedded devices. This is one version's API description, not a claim that every AGC works the same way. WebRTC AudioProcessing API, revision be1b8989
What AGC can and cannot solve
Speaker loudness and microphone distance can change recording level. AGC can reduce those level differences before transmission, storage, or speech recognition. The Speex preprocessing manual describes AGC as adjusting a signal toward a reference volume and gives VoIP as a case where it can reduce manual microphone-gain adjustment. Speex Codec Manual, preprocessor section
AGC does not separate speech from noise. If speech is buried in room or fan noise, raising gain raises both. It cannot restore waveform peaks already clipped at the input or converter. Raising gain in silence can make room and microphone noise conspicuous, while strong compression can flatten natural speech dynamics. AGC is also distinct from noise suppression, voice activity detection (VAD), and a limiter: they target noise components, speech presence, and peak ceilings, respectively.
Choose a mode and verify it
Record quiet, normal, and loud speech with AGC off. Check level, peaks, clipping, microphone distance, and orientation.
If the app can read and apply the device's analog level, consider adaptive analog mode. If that control path is unavailable, consider adaptive digital mode. A fixed gain can suit a predictable input.
Leave headroom below digital full scale. Listen for both intelligible quiet speech and noise during silence; do not copy another product's target blindly.
Compare separate scenes: close and moving speakers, background noise, silence, overlapping speech, and loud speech. Note noise increase, clipped word endings, and level pumping.
Change one setting at a time. Keep a baseline recording and use the same device and speech to compare AGC, noise suppression, VAD, or echo cancellation changes.
Developers should check the audio library version and capture path. The cited WebRTC APM API describes 10 ms linear PCM capture frames and different GainController1 and GainController2 paths. Do not generalize this to every operating system's microphone controls. After adjustment, compare the same recording before and after. If audio remains quiet, check the microphone connection, hardware input level, distance, and orientation before adding more software gain. If noise or pumping increases, reduce AGC or review its detection and compression settings. Re-record clipped input with a lower microphone level; software cannot repair the clipped waveform.
References
[WebRTC AudioProcessing API, revision be1b8989](https://webrtc.googlesource.com/src/%2B/be1b8989d1a231eaff6c0e11b30d69d576097904/modules/audio_processing/include/audio_processing.h)
[Speex Codec Manual, Codec description: Preprocessor](https://www.speex.org/docs/manual/speex-manual/node4.html)