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:
parent
5d85819dd2
commit
0b72f5863b
@ -186,6 +186,10 @@ void AudioProcessingImpl::SetExtraOptions(const Config& config) {
|
|||||||
(*it)->SetExtraOptions(config);
|
(*it)->SetExtraOptions(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int AudioProcessingImpl::EnableExperimentalNs(bool enable) {
|
||||||
|
return kNoError;
|
||||||
|
}
|
||||||
|
|
||||||
int AudioProcessingImpl::set_sample_rate_hz(int rate) {
|
int AudioProcessingImpl::set_sample_rate_hz(int rate) {
|
||||||
CriticalSectionScoped crit_scoped(crit_);
|
CriticalSectionScoped crit_scoped(crit_);
|
||||||
if (rate == sample_rate_hz_) {
|
if (rate == sample_rate_hz_) {
|
||||||
|
@ -59,6 +59,10 @@ class AudioProcessingImpl : public AudioProcessing {
|
|||||||
virtual int Initialize() OVERRIDE;
|
virtual int Initialize() OVERRIDE;
|
||||||
virtual int InitializeLocked();
|
virtual int InitializeLocked();
|
||||||
virtual void SetExtraOptions(const Config& config) OVERRIDE;
|
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 set_sample_rate_hz(int rate) OVERRIDE;
|
||||||
virtual int sample_rate_hz() const OVERRIDE;
|
virtual int sample_rate_hz() const OVERRIDE;
|
||||||
virtual int set_num_channels(int input_channels,
|
virtual int set_num_channels(int input_channels,
|
||||||
|
@ -155,6 +155,9 @@ class AudioProcessing : public Module {
|
|||||||
// ensures the options are applied immediately.
|
// ensures the options are applied immediately.
|
||||||
virtual void SetExtraOptions(const Config& config) = 0;
|
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
|
// Sets the sample |rate| in Hz for both the primary and reverse audio
|
||||||
// streams. 8000, 16000 or 32000 Hz are permitted.
|
// streams. 8000, 16000 or 32000 Hz are permitted.
|
||||||
virtual int set_sample_rate_hz(int rate) = 0;
|
virtual int set_sample_rate_hz(int rate) = 0;
|
||||||
|
@ -183,6 +183,10 @@ class MockAudioProcessing : public AudioProcessing {
|
|||||||
int());
|
int());
|
||||||
MOCK_METHOD1(SetExtraOptions,
|
MOCK_METHOD1(SetExtraOptions,
|
||||||
void(const Config& config));
|
void(const Config& config));
|
||||||
|
MOCK_METHOD1(EnableExperimentalNs,
|
||||||
|
int(bool enable));
|
||||||
|
MOCK_CONST_METHOD0(experimental_ns_enabled,
|
||||||
|
bool());
|
||||||
MOCK_METHOD1(set_sample_rate_hz,
|
MOCK_METHOD1(set_sample_rate_hz,
|
||||||
int(int rate));
|
int(int rate));
|
||||||
MOCK_CONST_METHOD0(sample_rate_hz,
|
MOCK_CONST_METHOD0(sample_rate_hz,
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "webrtc/common_types.h"
|
#include "webrtc/common_types.h"
|
||||||
#include "webrtc/engine_configurations.h"
|
#include "webrtc/engine_configurations.h"
|
||||||
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.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/system_wrappers/interface/scoped_ptr.h"
|
||||||
#include "webrtc/test/channel_transport/include/channel_transport.h"
|
#include "webrtc/test/channel_transport/include/channel_transport.h"
|
||||||
#include "webrtc/test/testsupport/fileutils.h"
|
#include "webrtc/test/testsupport/fileutils.h"
|
||||||
@ -242,6 +243,7 @@ void RunTest(std::string out_path) {
|
|||||||
bool muted = false;
|
bool muted = false;
|
||||||
bool on_hold = false;
|
bool on_hold = false;
|
||||||
bool opus_stereo = false;
|
bool opus_stereo = false;
|
||||||
|
bool experimental_ns_enabled = false;
|
||||||
|
|
||||||
#if defined(WEBRTC_ANDROID)
|
#if defined(WEBRTC_ANDROID)
|
||||||
std::string resource_path = "/sdcard/";
|
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 CNG\n", option_index++);
|
||||||
printf("%i. Toggle AGC\n", option_index++);
|
printf("%i. Toggle AGC\n", option_index++);
|
||||||
printf("%i. Toggle NS\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. Toggle EC\n", option_index++);
|
||||||
printf("%i. Select AEC\n", option_index++);
|
printf("%i. Select AEC\n", option_index++);
|
||||||
printf("%i. Select AECM\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");
|
printf("\n NS is now on! \n");
|
||||||
else
|
else
|
||||||
printf("\n NS is now off! \n");
|
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++) {
|
} else if (option_selection == option_index++) {
|
||||||
enable_aec = !enable_aec;
|
enable_aec = !enable_aec;
|
||||||
res = apm->SetEcStatus(enable_aec, kEcUnchanged);
|
res = apm->SetEcStatus(enable_aec, kEcUnchanged);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user