Index: webrtc/media/engine/webrtcvoiceengine.cc |
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc |
index ed67ce84ba00cc520872b1a17e0ea8bdbb579160..4624f91f589e3143d2a02a29843327ddedc7ca1a 100644 |
--- a/webrtc/media/engine/webrtcvoiceengine.cc |
+++ b/webrtc/media/engine/webrtcvoiceengine.cc |
@@ -577,6 +577,7 @@ WebRtcVoiceEngine::WebRtcVoiceEngine(webrtc::AudioDeviceModule* adm, |
options.extended_filter_aec = rtc::Optional<bool>(false); |
options.delay_agnostic_aec = rtc::Optional<bool>(false); |
options.experimental_ns = rtc::Optional<bool>(false); |
+ options.intelligibility_enhancer = rtc::Optional<bool>(false); |
bool error = ApplyOptions(options); |
RTC_DCHECK(error); |
} |
@@ -746,11 +747,20 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { |
} |
} |
+ if (options.intelligibility_enhancer) { |
+ intelligibility_enhancer_ = options.intelligibility_enhancer; |
+ } |
+ if (intelligibility_enhancer_ && *intelligibility_enhancer_) { |
+ LOG(LS_INFO) << "Enabling NS when Intelligibility Enhancer is active."; |
+ options.noise_suppression = intelligibility_enhancer_; |
+ } |
+ |
if (options.noise_suppression) { |
- const bool built_in_ns = adm()->BuiltInNSIsAvailable(); |
- if (built_in_ns) { |
- if (adm()->EnableBuiltInNS(*options.noise_suppression) == 0 && |
- *options.noise_suppression) { |
+ if (adm()->BuiltInNSIsAvailable()) { |
peah-webrtc
2016/05/13 12:39:49
I'm concerned about the AEC functionality as the I
aluebs-webrtc
2016/05/13 16:24:28
This CL doesn't enable IE, it just surfaces it to
peah-webrtc
2016/05/16 07:43:38
Thanks for the clarification! I definitely agree o
aluebs-webrtc
2016/05/16 20:21:16
I completely agree we should do a proper analysis
|
+ bool builtin_ns = |
+ *options.noise_suppression && |
+ !(intelligibility_enhancer_ && *intelligibility_enhancer_); |
+ if (adm()->EnableBuiltInNS(builtin_ns) == 0 && builtin_ns) { |
// Disable internal software NS if built-in NS is enabled, |
// i.e., replace the software NS with the built-in NS. |
options.noise_suppression = rtc::Optional<bool>(false); |
@@ -843,6 +853,13 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { |
new webrtc::ExperimentalNs(*experimental_ns_)); |
} |
+ if (intelligibility_enhancer_) { |
+ LOG(LS_INFO) << "Intelligibility Enhancer is enabled? " |
+ << *intelligibility_enhancer_; |
+ config.Set<webrtc::Intelligibility>( |
+ new webrtc::Intelligibility(*intelligibility_enhancer_)); |
+ } |
+ |
// We check audioproc for the benefit of tests, since FakeWebRtcVoiceEngine |
// returns NULL on audio_processing(). |
webrtc::AudioProcessing* audioproc = voe_wrapper_->base()->audio_processing(); |