diff options
author | aluebs@webrtc.org <aluebs@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-11-19 15:17:51 +0000 |
---|---|---|
committer | aluebs@webrtc.org <aluebs@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-11-19 15:17:51 +0000 |
commit | 09b40ec0ab87d85cb76b802e14a6240bf3e55d98 (patch) | |
tree | 471e6b16dd17147543149a86e5d95d752ebea56d | |
parent | 8b0791cb44f6a88ad175800485f67ba7e979209e (diff) | |
download | webrtc-09b40ec0ab87d85cb76b802e14a6240bf3e55d98.tar.gz |
Add experimental noise suppression dummy API.
Add this flag to the voe_cmd_test.
R=andrew@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/3879004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5134 4adac7df-926f-26a2-2b94-8c16560cd09d
5 files changed, 28 insertions, 0 deletions
diff --git a/modules/audio_processing/audio_processing_impl.cc b/modules/audio_processing/audio_processing_impl.cc index b33049e4..2eb97bfd 100644 --- a/modules/audio_processing/audio_processing_impl.cc +++ b/modules/audio_processing/audio_processing_impl.cc @@ -186,6 +186,10 @@ void AudioProcessingImpl::SetExtraOptions(const Config& config) { (*it)->SetExtraOptions(config); } +int AudioProcessingImpl::EnableExperimentalNs(bool enable) { + return kNoError; +} + int AudioProcessingImpl::set_sample_rate_hz(int rate) { CriticalSectionScoped crit_scoped(crit_); if (rate == sample_rate_hz_) { diff --git a/modules/audio_processing/audio_processing_impl.h b/modules/audio_processing/audio_processing_impl.h index b0afd6d3..6c228781 100644 --- a/modules/audio_processing/audio_processing_impl.h +++ b/modules/audio_processing/audio_processing_impl.h @@ -59,6 +59,10 @@ class AudioProcessingImpl : public AudioProcessing { virtual int Initialize() OVERRIDE; virtual int InitializeLocked(); virtual void SetExtraOptions(const Config& config) OVERRIDE; + virtual int EnableExperimentalNs(bool enable) OVERRIDE; + virtual bool experimental_ns_enabled() const OVERRIDE { + return false; + } virtual int set_sample_rate_hz(int rate) OVERRIDE; virtual int sample_rate_hz() const OVERRIDE; virtual int set_num_channels(int input_channels, diff --git a/modules/audio_processing/include/audio_processing.h b/modules/audio_processing/include/audio_processing.h index 1babe43a..82976499 100644 --- a/modules/audio_processing/include/audio_processing.h +++ b/modules/audio_processing/include/audio_processing.h @@ -155,6 +155,9 @@ class AudioProcessing : public Module { // ensures the options are applied immediately. virtual void SetExtraOptions(const Config& config) = 0; + virtual int EnableExperimentalNs(bool enable) = 0; + virtual bool experimental_ns_enabled() const = 0; + // Sets the sample |rate| in Hz for both the primary and reverse audio // streams. 8000, 16000 or 32000 Hz are permitted. virtual int set_sample_rate_hz(int rate) = 0; diff --git a/modules/audio_processing/include/mock_audio_processing.h b/modules/audio_processing/include/mock_audio_processing.h index 9a36fe84..c4600bda 100644 --- a/modules/audio_processing/include/mock_audio_processing.h +++ b/modules/audio_processing/include/mock_audio_processing.h @@ -183,6 +183,10 @@ class MockAudioProcessing : public AudioProcessing { int()); MOCK_METHOD1(SetExtraOptions, void(const Config& config)); + MOCK_METHOD1(EnableExperimentalNs, + int(bool enable)); + MOCK_CONST_METHOD0(experimental_ns_enabled, + bool()); MOCK_METHOD1(set_sample_rate_hz, int(int rate)); MOCK_CONST_METHOD0(sample_rate_hz, diff --git a/voice_engine/test/cmd_test/voe_cmd_test.cc b/voice_engine/test/cmd_test/voe_cmd_test.cc index 10fc198c..68d096dd 100644 --- a/voice_engine/test/cmd_test/voe_cmd_test.cc +++ b/voice_engine/test/cmd_test/voe_cmd_test.cc @@ -23,6 +23,7 @@ #include "webrtc/common_types.h" #include "webrtc/engine_configurations.h" #include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h" +#include "webrtc/modules/audio_processing/include/audio_processing.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/test/channel_transport/include/channel_transport.h" #include "webrtc/test/testsupport/fileutils.h" @@ -242,6 +243,7 @@ void RunTest(std::string out_path) { bool muted = false; bool on_hold = false; bool opus_stereo = false; + bool experimental_ns_enabled = false; #if defined(WEBRTC_ANDROID) std::string resource_path = "/sdcard/"; @@ -432,6 +434,7 @@ void RunTest(std::string out_path) { printf("%i. Toggle CNG\n", option_index++); printf("%i. Toggle AGC\n", option_index++); printf("%i. Toggle NS\n", option_index++); + printf("%i. Toggle experimental NS\n", option_index++); printf("%i. Toggle EC\n", option_index++); printf("%i. Select AEC\n", option_index++); printf("%i. Select AECM\n", option_index++); @@ -497,6 +500,16 @@ void RunTest(std::string out_path) { else printf("\n NS is now off! \n"); } else if (option_selection == option_index++) { + experimental_ns_enabled = !experimental_ns_enabled; + res = base1->audio_processing()->EnableExperimentalNs( + experimental_ns_enabled); + VALIDATE; + if (experimental_ns_enabled) { + printf("\n Experimental NS is now on!\n"); + } else { + printf("\n Experimental NS is now off!\n"); + } + } else if (option_selection == option_index++) { enable_aec = !enable_aec; res = apm->SetEcStatus(enable_aec, kEcUnchanged); VALIDATE; |