From 0f23fa876800f40804bf038c02e7d65f38f01863 Mon Sep 17 00:00:00 2001 From: aleloi Date: Thu, 11 May 2017 00:25:45 -0700 Subject: [PATCH] Disable the residual echo detector in audio mixer. The audio mixer has a subcomponent called FrameCombiner, which uses an AudioProcessing instance as a limiter. The limiter smoothly increases the volume to avoid causing clipping. The limiter was created in a default configuration causing the ResidualEchoDetector submodule of AudioProcessing to be activated. That submodule operates in the band-split domain (see AudioProcessingImpl::ApmSubmoduleStates::RenderMultiBandSubModulesActive()). There is a goal to remove the (expensive and unnecessary) band-splitting from AudioMixer. This change helps accomplish that. (It can't be done yet, because the actual limiter sub-component of APM also operates in the band-split domain). BUG=webrtc:6185 Review-Url: https://codereview.webrtc.org/2875623002 Cr-Commit-Position: refs/heads/master@{#18090} --- webrtc/modules/audio_mixer/frame_combiner.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webrtc/modules/audio_mixer/frame_combiner.cc b/webrtc/modules/audio_mixer/frame_combiner.cc index e47f8e75e2..3a7f61812b 100644 --- a/webrtc/modules/audio_mixer/frame_combiner.cc +++ b/webrtc/modules/audio_mixer/frame_combiner.cc @@ -135,9 +135,14 @@ void CombineMultipleFrames( std::unique_ptr CreateLimiter() { Config config; config.Set(new ExperimentalAgc(false)); + std::unique_ptr limiter(AudioProcessing::Create(config)); RTC_DCHECK(limiter); + webrtc::AudioProcessing::Config apm_config; + apm_config.residual_echo_detector.enabled = false; + limiter->ApplyConfig(apm_config); + const auto check_no_error = [](int x) { RTC_DCHECK_EQ(x, AudioProcessing::kNoError); };