How to collect diagnostic audio recordings

To debug some issue, you may need audio recordings, especially when investigating audio quality problems, such as distorted audio and echo issues.

To collect diagnostic audio recordings, open the chrome://webrtc-internals(Chrome) or edge://webrtc-internals(Edge) page.

When you click Enable diagnostic audio recordings, the browser prompts a dialog asking for the download file location.

Screenshot of diagnostic audio recordings settings.

After you finish an ACS call, you should be able to see files saved in the folder you choose.

Screenshot of diagnostic audio recording files.

*.output.N.wav is the audio output sent to the speaker.

*.input.M.wav is the audio input captured from the microphone.

*.aecdump contains the necessary wav files for debugging audio after processed by the audio processing module in browsers.

How to build tools for inspecting aecdump files

To inspect *.aecdump files, you must use the unpack_aecdump utility program, the source code can be found at unpack_aecdump

You need to prepare the build environment (Here we use Windows as an example)

Prerequisites:

Make sure you add depot_tools to the start of your PATH and it must be ahead of any installs of Python.

Run the following commands

mkdir webrtc
cd webrtc
gclient
fetch --nohooks webrtc
gclient sync
cd src
gn gen out/Default
ninja -C out/Default unpack_aecdump

The file is available at webrtc/src/out/Default/unpack_aecdump.exe

How to inspect aecdump files

Run the command:

unpack_aecdump.exe audio_debug.5.aecdump

Screenshot of the extracted aecdump file.

There are three different types of audio files extracted from the aecdump file

  • reverseN.wav: the rendered audio originated from the same process
  • inputN.wav: the captured audio, before audio processing.
  • ref_outN.wav: the captured audio, after audio processing and will be sent to the network.

If you think that audio quality issues are on the sending end, you can first check ref_outN.wav, find the possible problem time points, and compare them with the same time points in inputN.wav to see if the audio quality issues are caused by the audio processing module, or if the audio quality was already poor in the source.