Last updated: April 7, 2026

AEC stands for Acoustic Echo Cancellation.

AEC addresses the problem of the microphone capturing sound from the speakers (acoustic echo), especially in scenarios without headsets. When a remote participant’s voice plays through the local speakers and gets picked up by the local microphone, AEC removes this echo before sending audio to the remote side.

How AEC works in WebRTC

The AEC algorithm in libWebRTC:

  1. Captures the reference signal being played through the speakers
  2. Estimates the acoustic path from speakers to microphone (room impulse response)
  3. Generates a model of the expected echo
  4. Subtracts this modeled echo from the microphone signal

This process happens in real time with minimal added latency.

In some cases, AEC is disabled in WebRTC by the applications for certain reasons. In other cases, AEC is implemented by the device itself without any need of WebRTC to intervene (iPhone devices for example).

Challenges

AEC performance depends on the acoustic environment:

  • Room size and surfaces: Hard surfaces create stronger echoes
  • Speaker-to-mic distance: Closer proximity makes echo cancellation harder
  • Non-linear distortion: Cheap speakers introduce distortion that complicates echo modeling
  • Multiple speakers: Conference rooms with multiple speakers are particularly challenging
  • Device variability: WebRTC is unaware of the device in advance – position of the speaker and the microphone, their type and make, etc. This means it needs an algorithm that dynamically figures out the acoustic characteristics so it can factor them in

AEC works alongside other audio processing in WebRTC:

  • AGC (Automatic Gain Control) – normalizes volume levels
  • VAD (Voice Activity Detection) – detects speech vs. silence
  • Noise Suppression – removes background noise

Looking to learn more about WebRTC? 

Check my WebRTC training courses

About WebRTC Glossary

The WebRTC Glossary is an ongoing project where users can learn more about WebRTC related terms. It is maintained by Tsahi Levent-Levi of BlogGeek.me.