Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: webrtc/modules/audio_processing/test/audioproc_float.cc

Issue 2846853002: audioproc_f with fake microphone. (Closed)
Patch Set: Initialized FakeRecordingDevice, added 'kind' command line flag, fixed bugs. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 "Specify the NS level (0-3)"); 154 "Specify the NS level (0-3)");
155 DEFINE_int32(stream_delay, 155 DEFINE_int32(stream_delay,
156 kParameterNotSpecifiedValue, 156 kParameterNotSpecifiedValue,
157 "Specify the stream delay in ms to use"); 157 "Specify the stream delay in ms to use");
158 DEFINE_int32(stream_drift_samples, 158 DEFINE_int32(stream_drift_samples,
159 kParameterNotSpecifiedValue, 159 kParameterNotSpecifiedValue,
160 "Specify the number of stream drift samples to use"); 160 "Specify the number of stream drift samples to use");
161 DEFINE_bool(simulate_mic_gain, 161 DEFINE_bool(simulate_mic_gain,
162 false, 162 false,
163 "Simulate adjustable microphone analog gain"); 163 "Simulate adjustable microphone analog gain");
164 DEFINE_int32(simulated_mic_kind,
165 kParameterNotSpecifiedValue,
166 "Specify which microphone kind to use for microphone simulation");
164 DEFINE_bool(performance_report, false, "Report the APM performance "); 167 DEFINE_bool(performance_report, false, "Report the APM performance ");
165 DEFINE_bool(verbose, false, "Produce verbose output"); 168 DEFINE_bool(verbose, false, "Produce verbose output");
166 DEFINE_bool(bitexactness_report, 169 DEFINE_bool(bitexactness_report,
167 false, 170 false,
168 "Report bitexactness for aec dump result reproduction"); 171 "Report bitexactness for aec dump result reproduction");
169 DEFINE_bool(discard_settings_in_aecdump, 172 DEFINE_bool(discard_settings_in_aecdump,
170 false, 173 false,
171 "Discard any config settings specified in the aec dump"); 174 "Discard any config settings specified in the aec dump");
172 DEFINE_bool(store_intermediate_output, 175 DEFINE_bool(store_intermediate_output,
173 false, 176 false,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 SetSettingIfSpecified(FLAGS_agc_compression_gain, 264 SetSettingIfSpecified(FLAGS_agc_compression_gain,
262 &settings.agc_compression_gain); 265 &settings.agc_compression_gain);
263 SetSettingIfSpecified(FLAGS_vad_likelihood, &settings.vad_likelihood); 266 SetSettingIfSpecified(FLAGS_vad_likelihood, &settings.vad_likelihood);
264 SetSettingIfSpecified(FLAGS_ns_level, &settings.ns_level); 267 SetSettingIfSpecified(FLAGS_ns_level, &settings.ns_level);
265 SetSettingIfSpecified(FLAGS_stream_delay, &settings.stream_delay); 268 SetSettingIfSpecified(FLAGS_stream_delay, &settings.stream_delay);
266 SetSettingIfSpecified(FLAGS_stream_drift_samples, 269 SetSettingIfSpecified(FLAGS_stream_drift_samples,
267 &settings.stream_drift_samples); 270 &settings.stream_drift_samples);
268 SetSettingIfSpecified(FLAGS_custom_call_order_file, 271 SetSettingIfSpecified(FLAGS_custom_call_order_file,
269 &settings.custom_call_order_filename); 272 &settings.custom_call_order_filename);
270 settings.simulate_mic_gain = FLAGS_simulate_mic_gain; 273 settings.simulate_mic_gain = FLAGS_simulate_mic_gain;
274 SetSettingIfSpecified(FLAGS_simulated_mic_kind, &settings.simulated_mic_kind);
271 settings.report_performance = FLAGS_performance_report; 275 settings.report_performance = FLAGS_performance_report;
272 settings.use_verbose_logging = FLAGS_verbose; 276 settings.use_verbose_logging = FLAGS_verbose;
273 settings.report_bitexactness = FLAGS_bitexactness_report; 277 settings.report_bitexactness = FLAGS_bitexactness_report;
274 settings.discard_all_settings_in_aecdump = FLAGS_discard_settings_in_aecdump; 278 settings.discard_all_settings_in_aecdump = FLAGS_discard_settings_in_aecdump;
275 settings.fixed_interface = FLAGS_fixed_interface; 279 settings.fixed_interface = FLAGS_fixed_interface;
276 settings.store_intermediate_output = FLAGS_store_intermediate_output; 280 settings.store_intermediate_output = FLAGS_store_intermediate_output;
277 281
278 return settings; 282 return settings;
279 } 283 }
280 284
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 ReportConditionalErrorAndExit( 381 ReportConditionalErrorAndExit(
378 settings.report_bitexactness && !settings.aec_dump_input_filename, 382 settings.report_bitexactness && !settings.aec_dump_input_filename,
379 "Error: --bitexactness_report can only be used when operating on an " 383 "Error: --bitexactness_report can only be used when operating on an "
380 "aecdump\n"); 384 "aecdump\n");
381 385
382 ReportConditionalErrorAndExit( 386 ReportConditionalErrorAndExit(
383 settings.custom_call_order_filename && settings.aec_dump_input_filename, 387 settings.custom_call_order_filename && settings.aec_dump_input_filename,
384 "Error: --custom_call_order_file cannot be used when operating on an " 388 "Error: --custom_call_order_file cannot be used when operating on an "
385 "aecdump\n"); 389 "aecdump\n");
386 390
391 ReportConditionalErrorAndExit(
392 settings.simulated_mic_kind && !settings.simulate_mic_gain,
393 "Error: --simulated_mic_kind cannot be specified mic simulation is "
394 "disabled\n");
395
396 ReportConditionalErrorAndExit(
397 !settings.simulated_mic_kind && settings.simulate_mic_gain,
398 "Error: --simulated_mic_kind must be specified when mic simulation is "
399 "enabled\n");
400
387 auto valid_wav_name = [](const std::string& wav_file_name) { 401 auto valid_wav_name = [](const std::string& wav_file_name) {
388 if (wav_file_name.size() < 5) { 402 if (wav_file_name.size() < 5) {
389 return false; 403 return false;
390 } 404 }
391 if ((wav_file_name.compare(wav_file_name.size() - 4, 4, ".wav") == 0) || 405 if ((wav_file_name.compare(wav_file_name.size() - 4, 4, ".wav") == 0) ||
392 (wav_file_name.compare(wav_file_name.size() - 4, 4, ".WAV") == 0)) { 406 (wav_file_name.compare(wav_file_name.size() - 4, 4, ".WAV") == 0)) {
393 return true; 407 return true;
394 } 408 }
395 return false; 409 return false;
396 }; 410 };
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 476
463 return 0; 477 return 0;
464 } 478 }
465 479
466 } // namespace test 480 } // namespace test
467 } // namespace webrtc 481 } // namespace webrtc
468 482
469 int main(int argc, char* argv[]) { 483 int main(int argc, char* argv[]) {
470 return webrtc::test::main(argc, argv); 484 return webrtc::test::main(argc, argv);
471 } 485 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698