OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
570 options.highpass_filter = rtc::Optional<bool>(true); | 570 options.highpass_filter = rtc::Optional<bool>(true); |
571 options.stereo_swapping = rtc::Optional<bool>(false); | 571 options.stereo_swapping = rtc::Optional<bool>(false); |
572 options.audio_jitter_buffer_max_packets = rtc::Optional<int>(50); | 572 options.audio_jitter_buffer_max_packets = rtc::Optional<int>(50); |
573 options.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>(false); | 573 options.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>(false); |
574 options.typing_detection = rtc::Optional<bool>(true); | 574 options.typing_detection = rtc::Optional<bool>(true); |
575 options.adjust_agc_delta = rtc::Optional<int>(0); | 575 options.adjust_agc_delta = rtc::Optional<int>(0); |
576 options.experimental_agc = rtc::Optional<bool>(false); | 576 options.experimental_agc = rtc::Optional<bool>(false); |
577 options.extended_filter_aec = rtc::Optional<bool>(false); | 577 options.extended_filter_aec = rtc::Optional<bool>(false); |
578 options.delay_agnostic_aec = rtc::Optional<bool>(false); | 578 options.delay_agnostic_aec = rtc::Optional<bool>(false); |
579 options.experimental_ns = rtc::Optional<bool>(false); | 579 options.experimental_ns = rtc::Optional<bool>(false); |
580 options.intelligibility_enhancer = rtc::Optional<bool>(false); | |
580 bool error = ApplyOptions(options); | 581 bool error = ApplyOptions(options); |
581 RTC_DCHECK(error); | 582 RTC_DCHECK(error); |
582 } | 583 } |
583 | 584 |
584 SetDefaultDevices(); | 585 SetDefaultDevices(); |
585 } | 586 } |
586 | 587 |
587 WebRtcVoiceEngine::~WebRtcVoiceEngine() { | 588 WebRtcVoiceEngine::~WebRtcVoiceEngine() { |
588 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 589 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
589 LOG(LS_INFO) << "WebRtcVoiceEngine::~WebRtcVoiceEngine"; | 590 LOG(LS_INFO) << "WebRtcVoiceEngine::~WebRtcVoiceEngine"; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
739 options.tx_agc_limiter.value_or(default_agc_config_.limiterEnable); | 740 options.tx_agc_limiter.value_or(default_agc_config_.limiterEnable); |
740 if (voe_wrapper_->processing()->SetAgcConfig(default_agc_config_) == -1) { | 741 if (voe_wrapper_->processing()->SetAgcConfig(default_agc_config_) == -1) { |
741 LOG_RTCERR3(SetAgcConfig, | 742 LOG_RTCERR3(SetAgcConfig, |
742 default_agc_config_.targetLeveldBOv, | 743 default_agc_config_.targetLeveldBOv, |
743 default_agc_config_.digitalCompressionGaindB, | 744 default_agc_config_.digitalCompressionGaindB, |
744 default_agc_config_.limiterEnable); | 745 default_agc_config_.limiterEnable); |
745 return false; | 746 return false; |
746 } | 747 } |
747 } | 748 } |
748 | 749 |
750 if (options.intelligibility_enhancer) { | |
henrika_webrtc
2016/05/12 06:58:32
Please add logs here as well and verify that you n
aluebs-webrtc
2016/05/13 02:04:38
Good point! The log of "IE enabled" is below where
| |
751 intelligibility_enhancer_ = options.intelligibility_enhancer; | |
752 if (intelligibility_enhancer_ && *intelligibility_enhancer_) { | |
the sun
2016/05/12 11:50:01
why do you need the first half of this condition?
aluebs-webrtc
2016/05/13 02:04:38
That is exactly what I meant it to be, thank you :
| |
753 options.noise_suppression = intelligibility_enhancer_; | |
754 } | |
755 } | |
756 | |
749 if (options.noise_suppression) { | 757 if (options.noise_suppression) { |
750 const bool built_in_ns = adm()->BuiltInNSIsAvailable(); | 758 const bool built_in_ns = adm()->BuiltInNSIsAvailable(); |
751 if (built_in_ns) { | 759 if (built_in_ns) { |
752 if (adm()->EnableBuiltInNS(*options.noise_suppression) == 0 && | 760 bool builtin_ns = |
the sun
2016/05/12 11:50:01
You have one variable named "built_in_ns" and one
aluebs-webrtc
2016/05/13 02:04:38
Great suggestion! Done.
| |
753 *options.noise_suppression) { | 761 *options.noise_suppression && |
762 !(intelligibility_enhancer_ && * intelligibility_enhancer_); | |
the sun
2016/05/12 11:50:01
nit: no space after *
aluebs-webrtc
2016/05/13 02:04:38
Done.
| |
763 if (adm()->EnableBuiltInNS(builtin_ns) == 0 && builtin_ns) { | |
754 // Disable internal software NS if built-in NS is enabled, | 764 // Disable internal software NS if built-in NS is enabled, |
755 // i.e., replace the software NS with the built-in NS. | 765 // i.e., replace the software NS with the built-in NS. |
756 options.noise_suppression = rtc::Optional<bool>(false); | 766 options.noise_suppression = rtc::Optional<bool>(false); |
757 LOG(LS_INFO) << "Disabling NS since built-in NS will be used instead"; | 767 LOG(LS_INFO) << "Disabling NS since built-in NS will be used instead"; |
758 } | 768 } |
759 } | 769 } |
760 if (voep->SetNsStatus(*options.noise_suppression, ns_mode) == -1) { | 770 if (voep->SetNsStatus(*options.noise_suppression, ns_mode) == -1) { |
761 LOG_RTCERR2(SetNsStatus, *options.noise_suppression, ns_mode); | 771 LOG_RTCERR2(SetNsStatus, *options.noise_suppression, ns_mode); |
762 return false; | 772 return false; |
763 } else { | 773 } else { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
836 | 846 |
837 if (options.experimental_ns) { | 847 if (options.experimental_ns) { |
838 experimental_ns_ = options.experimental_ns; | 848 experimental_ns_ = options.experimental_ns; |
839 } | 849 } |
840 if (experimental_ns_) { | 850 if (experimental_ns_) { |
841 LOG(LS_INFO) << "Experimental ns is enabled? " << *experimental_ns_; | 851 LOG(LS_INFO) << "Experimental ns is enabled? " << *experimental_ns_; |
842 config.Set<webrtc::ExperimentalNs>( | 852 config.Set<webrtc::ExperimentalNs>( |
843 new webrtc::ExperimentalNs(*experimental_ns_)); | 853 new webrtc::ExperimentalNs(*experimental_ns_)); |
844 } | 854 } |
845 | 855 |
856 if (intelligibility_enhancer_) { | |
857 LOG(LS_INFO) << "Intelligibility Enhancer is enabled? " | |
858 << *intelligibility_enhancer_; | |
859 config.Set<webrtc::Intelligibility>( | |
860 new webrtc::Intelligibility(*intelligibility_enhancer_)); | |
861 } | |
862 | |
846 // We check audioproc for the benefit of tests, since FakeWebRtcVoiceEngine | 863 // We check audioproc for the benefit of tests, since FakeWebRtcVoiceEngine |
847 // returns NULL on audio_processing(). | 864 // returns NULL on audio_processing(). |
848 webrtc::AudioProcessing* audioproc = voe_wrapper_->base()->audio_processing(); | 865 webrtc::AudioProcessing* audioproc = voe_wrapper_->base()->audio_processing(); |
849 if (audioproc) { | 866 if (audioproc) { |
850 audioproc->SetExtraOptions(config); | 867 audioproc->SetExtraOptions(config); |
851 } | 868 } |
852 | 869 |
853 if (options.recording_sample_rate) { | 870 if (options.recording_sample_rate) { |
854 LOG(LS_INFO) << "Recording sample rate is " | 871 LOG(LS_INFO) << "Recording sample rate is " |
855 << *options.recording_sample_rate; | 872 << *options.recording_sample_rate; |
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2556 } | 2573 } |
2557 } else { | 2574 } else { |
2558 LOG(LS_INFO) << "Stopping playout for channel #" << channel; | 2575 LOG(LS_INFO) << "Stopping playout for channel #" << channel; |
2559 engine()->voe()->base()->StopPlayout(channel); | 2576 engine()->voe()->base()->StopPlayout(channel); |
2560 } | 2577 } |
2561 return true; | 2578 return true; |
2562 } | 2579 } |
2563 } // namespace cricket | 2580 } // namespace cricket |
2564 | 2581 |
2565 #endif // HAVE_WEBRTC_VOICE | 2582 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |