Robustify the AEC3 inaudible echo detection
This CL robustifies the inaudible echo detection in AEC3 such that a
requirement is that either the render and capture signals are aligned
or that a headset has been detected. This ensures that the inaudible
detection has been able to base the desicion on reliable signals.
BUG=webrtc:8150
Review-Url: https://codereview.webrtc.org/3005503002
Cr-Original-Commit-Position: refs/heads/master@{#19491}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 85864be8ef21d00ffd2a9cf80ea03ac4d239e5f1
diff --git a/modules/audio_processing/aec3/residual_echo_estimator.cc b/modules/audio_processing/aec3/residual_echo_estimator.cc
index f3b3106..c5df82c 100644
--- a/modules/audio_processing/aec3/residual_echo_estimator.cc
+++ b/modules/audio_processing/aec3/residual_echo_estimator.cc
@@ -144,7 +144,8 @@
}
// If the echo is deemed inaudible, set the residual echo to zero.
- if (aec_state.InaudibleEcho()) {
+ if (aec_state.InaudibleEcho() &&
+ (aec_state.ExternalDelay() || aec_state.HeadsetDetected())) {
R2->fill(0.f);
}