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@5134 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
aluebs@webrtc.org 2013-11-19 15:17:51 +00:00
parent 5d85819dd2
commit 0b72f5863b
5 changed files with 28 additions and 0 deletions

View File

@ -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_) {

View File

@ -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,

View File

@ -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;

View File

@ -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,

View File

@ -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++);
@ -496,6 +499,16 @@ void RunTest(std::string out_path) {
printf("\n NS is now on! \n");
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);