OLD | NEW |
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 Loading... |
154 "Specify the VAD likelihood (0-3)"); | 154 "Specify the VAD likelihood (0-3)"); |
155 DEFINE_int32(ns_level, | 155 DEFINE_int32(ns_level, |
156 kParameterNotSpecifiedValue, | 156 kParameterNotSpecifiedValue, |
157 "Specify the NS level (0-3)"); | 157 "Specify the NS level (0-3)"); |
158 DEFINE_int32(stream_delay, | 158 DEFINE_int32(stream_delay, |
159 kParameterNotSpecifiedValue, | 159 kParameterNotSpecifiedValue, |
160 "Specify the stream delay in ms to use"); | 160 "Specify the stream delay in ms to use"); |
161 DEFINE_int32(stream_drift_samples, | 161 DEFINE_int32(stream_drift_samples, |
162 kParameterNotSpecifiedValue, | 162 kParameterNotSpecifiedValue, |
163 "Specify the number of stream drift samples to use"); | 163 "Specify the number of stream drift samples to use"); |
| 164 DEFINE_int32(initial_mic_level, 100, "Initial mic level (0-255)"); |
| 165 DEFINE_bool(simulate_mic_gain, |
| 166 false, |
| 167 "Simulate adjustable microphone analog gain"); |
| 168 DEFINE_int32(simulated_mic_kind, |
| 169 kParameterNotSpecifiedValue, |
| 170 "Specify which microphone kind to use for microphone simulation"); |
164 DEFINE_bool(performance_report, false, "Report the APM performance "); | 171 DEFINE_bool(performance_report, false, "Report the APM performance "); |
165 DEFINE_bool(verbose, false, "Produce verbose output"); | 172 DEFINE_bool(verbose, false, "Produce verbose output"); |
166 DEFINE_bool(bitexactness_report, | 173 DEFINE_bool(bitexactness_report, |
167 false, | 174 false, |
168 "Report bitexactness for aec dump result reproduction"); | 175 "Report bitexactness for aec dump result reproduction"); |
169 DEFINE_bool(discard_settings_in_aecdump, | 176 DEFINE_bool(discard_settings_in_aecdump, |
170 false, | 177 false, |
171 "Discard any config settings specified in the aec dump"); | 178 "Discard any config settings specified in the aec dump"); |
172 DEFINE_bool(store_intermediate_output, | 179 DEFINE_bool(store_intermediate_output, |
173 false, | 180 false, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 SetSettingIfFlagSet(FLAGS_agc_limiter, &settings.use_agc_limiter); | 268 SetSettingIfFlagSet(FLAGS_agc_limiter, &settings.use_agc_limiter); |
262 SetSettingIfSpecified(FLAGS_agc_compression_gain, | 269 SetSettingIfSpecified(FLAGS_agc_compression_gain, |
263 &settings.agc_compression_gain); | 270 &settings.agc_compression_gain); |
264 SetSettingIfSpecified(FLAGS_vad_likelihood, &settings.vad_likelihood); | 271 SetSettingIfSpecified(FLAGS_vad_likelihood, &settings.vad_likelihood); |
265 SetSettingIfSpecified(FLAGS_ns_level, &settings.ns_level); | 272 SetSettingIfSpecified(FLAGS_ns_level, &settings.ns_level); |
266 SetSettingIfSpecified(FLAGS_stream_delay, &settings.stream_delay); | 273 SetSettingIfSpecified(FLAGS_stream_delay, &settings.stream_delay); |
267 SetSettingIfSpecified(FLAGS_stream_drift_samples, | 274 SetSettingIfSpecified(FLAGS_stream_drift_samples, |
268 &settings.stream_drift_samples); | 275 &settings.stream_drift_samples); |
269 SetSettingIfSpecified(FLAGS_custom_call_order_file, | 276 SetSettingIfSpecified(FLAGS_custom_call_order_file, |
270 &settings.custom_call_order_filename); | 277 &settings.custom_call_order_filename); |
| 278 settings.initial_mic_level = FLAGS_initial_mic_level; |
| 279 settings.simulate_mic_gain = FLAGS_simulate_mic_gain; |
| 280 SetSettingIfSpecified(FLAGS_simulated_mic_kind, &settings.simulated_mic_kind); |
271 settings.report_performance = FLAGS_performance_report; | 281 settings.report_performance = FLAGS_performance_report; |
272 settings.use_verbose_logging = FLAGS_verbose; | 282 settings.use_verbose_logging = FLAGS_verbose; |
273 settings.report_bitexactness = FLAGS_bitexactness_report; | 283 settings.report_bitexactness = FLAGS_bitexactness_report; |
274 settings.discard_all_settings_in_aecdump = FLAGS_discard_settings_in_aecdump; | 284 settings.discard_all_settings_in_aecdump = FLAGS_discard_settings_in_aecdump; |
275 settings.fixed_interface = FLAGS_fixed_interface; | 285 settings.fixed_interface = FLAGS_fixed_interface; |
276 settings.store_intermediate_output = FLAGS_store_intermediate_output; | 286 settings.store_intermediate_output = FLAGS_store_intermediate_output; |
277 | 287 |
278 return settings; | 288 return settings; |
279 } | 289 } |
280 | 290 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 ReportConditionalErrorAndExit( | 387 ReportConditionalErrorAndExit( |
378 settings.report_bitexactness && !settings.aec_dump_input_filename, | 388 settings.report_bitexactness && !settings.aec_dump_input_filename, |
379 "Error: --bitexactness_report can only be used when operating on an " | 389 "Error: --bitexactness_report can only be used when operating on an " |
380 "aecdump\n"); | 390 "aecdump\n"); |
381 | 391 |
382 ReportConditionalErrorAndExit( | 392 ReportConditionalErrorAndExit( |
383 settings.custom_call_order_filename && settings.aec_dump_input_filename, | 393 settings.custom_call_order_filename && settings.aec_dump_input_filename, |
384 "Error: --custom_call_order_file cannot be used when operating on an " | 394 "Error: --custom_call_order_file cannot be used when operating on an " |
385 "aecdump\n"); | 395 "aecdump\n"); |
386 | 396 |
| 397 ReportConditionalErrorAndExit( |
| 398 (settings.initial_mic_level < 0 || settings.initial_mic_level > 255), |
| 399 "Error: --initial_mic_level must be specified between 0 and 255.\n"); |
| 400 |
| 401 ReportConditionalErrorAndExit( |
| 402 settings.simulated_mic_kind && !settings.simulate_mic_gain, |
| 403 "Error: --simulated_mic_kind cannot be specified when mic simulation is " |
| 404 "disabled\n"); |
| 405 |
| 406 ReportConditionalErrorAndExit( |
| 407 !settings.simulated_mic_kind && settings.simulate_mic_gain, |
| 408 "Error: --simulated_mic_kind must be specified when mic simulation is " |
| 409 "enabled\n"); |
| 410 |
387 auto valid_wav_name = [](const std::string& wav_file_name) { | 411 auto valid_wav_name = [](const std::string& wav_file_name) { |
388 if (wav_file_name.size() < 5) { | 412 if (wav_file_name.size() < 5) { |
389 return false; | 413 return false; |
390 } | 414 } |
391 if ((wav_file_name.compare(wav_file_name.size() - 4, 4, ".wav") == 0) || | 415 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)) { | 416 (wav_file_name.compare(wav_file_name.size() - 4, 4, ".WAV") == 0)) { |
393 return true; | 417 return true; |
394 } | 418 } |
395 return false; | 419 return false; |
396 }; | 420 }; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 | 486 |
463 return 0; | 487 return 0; |
464 } | 488 } |
465 | 489 |
466 } // namespace test | 490 } // namespace test |
467 } // namespace webrtc | 491 } // namespace webrtc |
468 | 492 |
469 int main(int argc, char* argv[]) { | 493 int main(int argc, char* argv[]) { |
470 return webrtc::test::main(argc, argv); | 494 return webrtc::test::main(argc, argv); |
471 } | 495 } |
OLD | NEW |