diff --git a/api/audio/echo_canceller3_config.h b/api/audio/echo_canceller3_config.h index dec9e06d74..d88c9c450c 100644 --- a/api/audio/echo_canceller3_config.h +++ b/api/audio/echo_canceller3_config.h @@ -182,15 +182,15 @@ struct EchoCanceller3Config { MaskingThresholds(.07f, .1f, .3f), 2.0f, 0.25f); - Tuning nearend_tuning = Tuning(MaskingThresholds(.2f, .3f, .3f), - MaskingThresholds(.07f, .1f, .3f), + Tuning nearend_tuning = Tuning(MaskingThresholds(1.09f, 1.1f, .3f), + MaskingThresholds(.1f, .3f, .3f), 2.0f, 0.25f); struct DominantNearendDetection { - float enr_threshold = 10.f; - float snr_threshold = 10.f; - int hold_duration = 25; + float enr_threshold = 6.f; + float snr_threshold = 6.f; + int hold_duration = 5; int trigger_threshold = 15; } dominant_nearend_detection; diff --git a/modules/audio_processing/aec3/echo_canceller3.cc b/modules/audio_processing/aec3/echo_canceller3.cc index e331c1887b..271d38422f 100644 --- a/modules/audio_processing/aec3/echo_canceller3.cc +++ b/modules/audio_processing/aec3/echo_canceller3.cc @@ -70,6 +70,10 @@ bool EnableNewFilterParams() { return !field_trial::IsEnabled("WebRTC-Aec3NewFilterParamsKillSwitch"); } +bool EnableLegacyDominantNearend() { + return field_trial::IsEnabled("WebRTC-Aec3EnableLegacyDominantNearend"); +} + // Method for adjusting config parameter dependencies.. EchoCanceller3Config AdjustConfig(const EchoCanceller3Config& config) { EchoCanceller3Config adjusted_cfg = config; @@ -166,6 +170,18 @@ EchoCanceller3Config AdjustConfig(const EchoCanceller3Config& config) { adjusted_cfg.ep_strength.default_len = 0.88f; } + if (EnableLegacyDominantNearend()) { + adjusted_cfg.suppressor.nearend_tuning = + EchoCanceller3Config::Suppressor::Tuning( + EchoCanceller3Config::Suppressor::MaskingThresholds(.2f, .3f, .3f), + EchoCanceller3Config::Suppressor::MaskingThresholds(.07f, .1f, .3f), + 2.0f, 0.25f); + + adjusted_cfg.suppressor.dominant_nearend_detection.enr_threshold = 10.f; + adjusted_cfg.suppressor.dominant_nearend_detection.snr_threshold = 10.f; + adjusted_cfg.suppressor.dominant_nearend_detection.hold_duration = 25; + } + return adjusted_cfg; }