Add ExperimentalNs support in Config
R=andrew@webrtc.org, xians@webrtc.org Review URL: https://webrtc-codereview.appspot.com/17829004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6567 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
2be53a3b00
commit
9825afc3bd
@ -73,6 +73,14 @@ struct ExperimentalAgc {
|
||||
bool enabled;
|
||||
};
|
||||
|
||||
// Use to enable experimental noise suppression. It can be set in the
|
||||
// constructor or using AudioProcessing::SetExtraOptions().
|
||||
struct ExperimentalNs {
|
||||
ExperimentalNs() : enabled(false) {}
|
||||
explicit ExperimentalNs(bool enabled) : enabled(enabled) {}
|
||||
bool enabled;
|
||||
};
|
||||
|
||||
static const int kAudioProcMaxNativeSampleRateHz = 32000;
|
||||
|
||||
// The Audio Processing Module (APM) provides a collection of voice processing
|
||||
|
@ -400,7 +400,9 @@ void void_main(int argc, char* argv[]) {
|
||||
vad_out_filename = argv[i];
|
||||
|
||||
} else if (strcmp(argv[i], "-expns") == 0) {
|
||||
ASSERT_EQ(apm->kNoError, apm->EnableExperimentalNs(true));
|
||||
Config config;
|
||||
config.Set<ExperimentalNs>(new ExperimentalNs(true));
|
||||
apm->SetExtraOptions(config);
|
||||
|
||||
} else if (strcmp(argv[i], "--noasm") == 0) {
|
||||
WebRtc_GetCPUInfo = WebRtc_GetCPUInfoNoASM;
|
||||
|
@ -485,9 +485,9 @@ void RunTest(std::string out_path) {
|
||||
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;
|
||||
Config config;
|
||||
config.Set<ExperimentalNs>(new ExperimentalNs(experimental_ns_enabled));
|
||||
base1->audio_processing()->SetExtraOptions(config);
|
||||
if (experimental_ns_enabled) {
|
||||
printf("\n Experimental NS is now on!\n");
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user