diff --git a/webrtc/media/base/mediachannel.h b/webrtc/media/base/mediachannel.h index b254a14933..80b9d4d44c 100644 --- a/webrtc/media/base/mediachannel.h +++ b/webrtc/media/base/mediachannel.h @@ -156,6 +156,7 @@ struct AudioOptions { SetFrom(&experimental_ns, change.experimental_ns); SetFrom(&intelligibility_enhancer, change.intelligibility_enhancer); SetFrom(&level_control, change.level_control); + SetFrom(&residual_echo_detector, change.residual_echo_detector); SetFrom(&tx_agc_target_dbov, change.tx_agc_target_dbov); SetFrom(&tx_agc_digital_compression_gain, change.tx_agc_digital_compression_gain); @@ -187,6 +188,7 @@ struct AudioOptions { experimental_ns == o.experimental_ns && intelligibility_enhancer == o.intelligibility_enhancer && level_control == o.level_control && + residual_echo_detector == o.residual_echo_detector && adjust_agc_delta == o.adjust_agc_delta && tx_agc_target_dbov == o.tx_agc_target_dbov && tx_agc_digital_compression_gain == @@ -225,6 +227,7 @@ struct AudioOptions { ost << ToStringIfSet("level_control", level_control); ost << ToStringIfSet("level_control_initial_peak_level_dbfs", level_control_initial_peak_level_dbfs); + ost << ToStringIfSet("residual_echo_detector", residual_echo_detector); ost << ToStringIfSet("tx_agc_target_dbov", tx_agc_target_dbov); ost << ToStringIfSet("tx_agc_digital_compression_gain", tx_agc_digital_compression_gain); @@ -269,6 +272,7 @@ struct AudioOptions { // Specifies an optional initialization value for the level controller. rtc::Optional level_control_initial_peak_level_dbfs; // Note that tx_agc_* only applies to non-experimental AGC. + rtc::Optional residual_echo_detector; rtc::Optional tx_agc_target_dbov; rtc::Optional tx_agc_digital_compression_gain; rtc::Optional tx_agc_limiter; diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc index 35629da722..9d6f19554c 100644 --- a/webrtc/media/engine/webrtcvoiceengine.cc +++ b/webrtc/media/engine/webrtcvoiceengine.cc @@ -606,6 +606,13 @@ WebRtcVoiceEngine::WebRtcVoiceEngine( options.experimental_ns = rtc::Optional(false); options.intelligibility_enhancer = rtc::Optional(false); options.level_control = rtc::Optional(false); +// TODO(ivoc): Always enable residual echo detector after benchmarking on +// mobile. +#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) + options.residual_echo_detector = rtc::Optional(false); +#else + options.residual_echo_detector = rtc::Optional(true); +#endif bool error = ApplyOptions(options); RTC_DCHECK(error); } @@ -670,6 +677,7 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { options.experimental_agc = rtc::Optional(false); options.extended_filter_aec = rtc::Optional(false); options.experimental_ns = rtc::Optional(false); + options.residual_echo_detector = rtc::Optional(false); #endif // Delay Agnostic AEC automatically turns on EC if not set except on iOS diff --git a/webrtc/modules/audio_processing/include/audio_processing.h b/webrtc/modules/audio_processing/include/audio_processing.h index c899e803e1..2c0f554607 100644 --- a/webrtc/modules/audio_processing/include/audio_processing.h +++ b/webrtc/modules/audio_processing/include/audio_processing.h @@ -259,7 +259,11 @@ class AudioProcessing { float initial_peak_level_dbfs = -6.0206f; } level_controller; struct ResidualEchoDetector { +#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) bool enabled = false; +#else + bool enabled = true; +#endif } residual_echo_detector; };