From bc1d22461b300624a8b0f81c1535624f4cd6e95a Mon Sep 17 00:00:00 2001 From: "aluebs@webrtc.org" Date: Tue, 25 Feb 2014 16:50:22 +0000 Subject: [PATCH] Add experimental noise suppression flag to audioproc test R=andrew@webrtc.org Review URL: https://webrtc-codereview.appspot.com/8889004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5608 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/audio_processing/test/process_test.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webrtc/modules/audio_processing/test/process_test.cc b/webrtc/modules/audio_processing/test/process_test.cc index 8a5d0f5fd6..05d7eea758 100644 --- a/webrtc/modules/audio_processing/test/process_test.cc +++ b/webrtc/modules/audio_processing/test/process_test.cc @@ -132,6 +132,7 @@ void usage() { printf(" --ns_prob_file FILE\n"); printf("\n -vad Voice activity detection\n"); printf(" --vad_out_file FILE\n"); + printf("\n -expns Experimental Noise suppression\n"); printf("\n Level metrics (enabled by default)\n"); printf(" --no_level_metrics\n"); printf("\n"); @@ -426,6 +427,9 @@ void void_main(int argc, char* argv[]) { ASSERT_LT(i, argc) << "Specify filename after --vad_out_file"; vad_out_filename = argv[i]; + } else if (strcmp(argv[i], "-expns") == 0) { + ASSERT_EQ(apm->kNoError, apm->EnableExperimentalNs(true)); + } else if (strcmp(argv[i], "--noasm") == 0) { WebRtc_GetCPUInfo = WebRtc_GetCPUInfoNoASM; // We need to reinitialize here if components have already been enabled. @@ -722,6 +726,12 @@ void void_main(int argc, char* argv[]) { apm->set_stream_delay_ms(delay_ms)); apm->echo_cancellation()->set_stream_drift_samples(msg.drift()); + if (msg.has_keypress()) { + apm->set_stream_key_pressed(msg.keypress()); + } else { + apm->set_stream_key_pressed(true); + } + int err = apm->ProcessStream(&near_frame); if (err == apm->kBadStreamParameterWarning) { printf("Bad parameter warning. %s\n", trace_stream.str().c_str()); @@ -930,6 +940,8 @@ void void_main(int argc, char* argv[]) { apm->set_stream_delay_ms(delay_ms)); apm->echo_cancellation()->set_stream_drift_samples(drift_samples); + apm->set_stream_key_pressed(true); + int err = apm->ProcessStream(&near_frame); if (err == apm->kBadStreamParameterWarning) { printf("Bad parameter warning. %s\n", trace_stream.str().c_str());