| 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 22 matching lines...) Expand all Loading... |
| 33 "Command-line tool to simulate a call using the audio " | 33 "Command-line tool to simulate a call using the audio " |
| 34 "processing module, either based on wav files or " | 34 "processing module, either based on wav files or " |
| 35 "protobuf debug dump recordings."; | 35 "protobuf debug dump recordings."; |
| 36 | 36 |
| 37 DEFINE_string(dump_input, "", "Aec dump input filename"); | 37 DEFINE_string(dump_input, "", "Aec dump input filename"); |
| 38 DEFINE_string(dump_output, "", "Aec dump output filename"); | 38 DEFINE_string(dump_output, "", "Aec dump output filename"); |
| 39 DEFINE_string(i, "", "Forward stream input wav filename"); | 39 DEFINE_string(i, "", "Forward stream input wav filename"); |
| 40 DEFINE_string(o, "", "Forward stream output wav filename"); | 40 DEFINE_string(o, "", "Forward stream output wav filename"); |
| 41 DEFINE_string(ri, "", "Reverse stream input wav filename"); | 41 DEFINE_string(ri, "", "Reverse stream input wav filename"); |
| 42 DEFINE_string(ro, "", "Reverse stream output wav filename"); | 42 DEFINE_string(ro, "", "Reverse stream output wav filename"); |
| 43 DEFINE_string(artificial_nearend, "", "Artificial nearend wav filename"); |
| 43 DEFINE_int32(output_num_channels, | 44 DEFINE_int32(output_num_channels, |
| 44 kParameterNotSpecifiedValue, | 45 kParameterNotSpecifiedValue, |
| 45 "Number of forward stream output channels"); | 46 "Number of forward stream output channels"); |
| 46 DEFINE_int32(reverse_output_num_channels, | 47 DEFINE_int32(reverse_output_num_channels, |
| 47 kParameterNotSpecifiedValue, | 48 kParameterNotSpecifiedValue, |
| 48 "Number of Reverse stream output channels"); | 49 "Number of Reverse stream output channels"); |
| 49 DEFINE_int32(output_sample_rate_hz, | 50 DEFINE_int32(output_sample_rate_hz, |
| 50 kParameterNotSpecifiedValue, | 51 kParameterNotSpecifiedValue, |
| 51 "Forward stream output sample rate in Hz"); | 52 "Forward stream output sample rate in Hz"); |
| 52 DEFINE_int32(reverse_output_sample_rate_hz, | 53 DEFINE_int32(reverse_output_sample_rate_hz, |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 settings.use_aec = rtc::Optional<bool>(true); | 202 settings.use_aec = rtc::Optional<bool>(true); |
| 202 settings.use_aecm = rtc::Optional<bool>(false); | 203 settings.use_aecm = rtc::Optional<bool>(false); |
| 203 settings.use_ed = rtc::Optional<bool>(false); | 204 settings.use_ed = rtc::Optional<bool>(false); |
| 204 } | 205 } |
| 205 SetSettingIfSpecified(FLAGS_dump_input, &settings.aec_dump_input_filename); | 206 SetSettingIfSpecified(FLAGS_dump_input, &settings.aec_dump_input_filename); |
| 206 SetSettingIfSpecified(FLAGS_dump_output, &settings.aec_dump_output_filename); | 207 SetSettingIfSpecified(FLAGS_dump_output, &settings.aec_dump_output_filename); |
| 207 SetSettingIfSpecified(FLAGS_i, &settings.input_filename); | 208 SetSettingIfSpecified(FLAGS_i, &settings.input_filename); |
| 208 SetSettingIfSpecified(FLAGS_o, &settings.output_filename); | 209 SetSettingIfSpecified(FLAGS_o, &settings.output_filename); |
| 209 SetSettingIfSpecified(FLAGS_ri, &settings.reverse_input_filename); | 210 SetSettingIfSpecified(FLAGS_ri, &settings.reverse_input_filename); |
| 210 SetSettingIfSpecified(FLAGS_ro, &settings.reverse_output_filename); | 211 SetSettingIfSpecified(FLAGS_ro, &settings.reverse_output_filename); |
| 212 SetSettingIfSpecified(FLAGS_artificial_nearend, |
| 213 &settings.artificial_nearend_filename); |
| 211 SetSettingIfSpecified(FLAGS_output_num_channels, | 214 SetSettingIfSpecified(FLAGS_output_num_channels, |
| 212 &settings.output_num_channels); | 215 &settings.output_num_channels); |
| 213 SetSettingIfSpecified(FLAGS_reverse_output_num_channels, | 216 SetSettingIfSpecified(FLAGS_reverse_output_num_channels, |
| 214 &settings.reverse_output_num_channels); | 217 &settings.reverse_output_num_channels); |
| 215 SetSettingIfSpecified(FLAGS_output_sample_rate_hz, | 218 SetSettingIfSpecified(FLAGS_output_sample_rate_hz, |
| 216 &settings.output_sample_rate_hz); | 219 &settings.output_sample_rate_hz); |
| 217 SetSettingIfSpecified(FLAGS_reverse_output_sample_rate_hz, | 220 SetSettingIfSpecified(FLAGS_reverse_output_sample_rate_hz, |
| 218 &settings.reverse_output_sample_rate_hz); | 221 &settings.reverse_output_sample_rate_hz); |
| 219 SetSettingIfSpecified(FLAGS_mic_positions, &settings.microphone_positions); | 222 SetSettingIfSpecified(FLAGS_mic_positions, &settings.microphone_positions); |
| 220 settings.target_angle_degrees = FLAGS_target_angle_degrees; | 223 settings.target_angle_degrees = FLAGS_target_angle_degrees; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 exit(1); | 273 exit(1); |
| 271 } | 274 } |
| 272 } | 275 } |
| 273 | 276 |
| 274 void PerformBasicParameterSanityChecks(const SimulationSettings& settings) { | 277 void PerformBasicParameterSanityChecks(const SimulationSettings& settings) { |
| 275 if (settings.input_filename || settings.reverse_input_filename) { | 278 if (settings.input_filename || settings.reverse_input_filename) { |
| 276 ReportConditionalErrorAndExit(!!settings.aec_dump_input_filename, | 279 ReportConditionalErrorAndExit(!!settings.aec_dump_input_filename, |
| 277 "Error: The aec dump cannot be specified " | 280 "Error: The aec dump cannot be specified " |
| 278 "together with input wav files!\n"); | 281 "together with input wav files!\n"); |
| 279 | 282 |
| 283 ReportConditionalErrorAndExit(!!settings.artificial_nearend_filename, |
| 284 "Error: The artificial nearend cannot be " |
| 285 "specified together with input wav files!\n"); |
| 286 |
| 280 ReportConditionalErrorAndExit(!settings.input_filename, | 287 ReportConditionalErrorAndExit(!settings.input_filename, |
| 281 "Error: When operating at wav files, the " | 288 "Error: When operating at wav files, the " |
| 282 "input wav filename must be " | 289 "input wav filename must be " |
| 283 "specified!\n"); | 290 "specified!\n"); |
| 284 | 291 |
| 285 ReportConditionalErrorAndExit( | 292 ReportConditionalErrorAndExit( |
| 286 settings.reverse_output_filename && !settings.reverse_input_filename, | 293 settings.reverse_output_filename && !settings.reverse_input_filename, |
| 287 "Error: When operating at wav files, the reverse input wav filename " | 294 "Error: When operating at wav files, the reverse input wav filename " |
| 288 "must be specified if the reverse output wav filename is specified!\n"); | 295 "must be specified if the reverse output wav filename is specified!\n"); |
| 289 } else { | 296 } else { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 389 |
| 383 ReportConditionalErrorAndExit( | 390 ReportConditionalErrorAndExit( |
| 384 settings.reverse_input_filename && | 391 settings.reverse_input_filename && |
| 385 (!valid_wav_name(*settings.reverse_input_filename)), | 392 (!valid_wav_name(*settings.reverse_input_filename)), |
| 386 "Error: --ri must be a valid .wav file name.\n"); | 393 "Error: --ri must be a valid .wav file name.\n"); |
| 387 | 394 |
| 388 ReportConditionalErrorAndExit( | 395 ReportConditionalErrorAndExit( |
| 389 settings.reverse_output_filename && | 396 settings.reverse_output_filename && |
| 390 (!valid_wav_name(*settings.reverse_output_filename)), | 397 (!valid_wav_name(*settings.reverse_output_filename)), |
| 391 "Error: --ro must be a valid .wav file name.\n"); | 398 "Error: --ro must be a valid .wav file name.\n"); |
| 399 |
| 400 ReportConditionalErrorAndExit( |
| 401 settings.artificial_nearend_filename && |
| 402 !valid_wav_name(*settings.artificial_nearend_filename), |
| 403 "Error: --artifical_nearend must be a valid .wav file name.\n"); |
| 392 } | 404 } |
| 393 | 405 |
| 394 } // namespace | 406 } // namespace |
| 395 | 407 |
| 396 int main(int argc, char* argv[]) { | 408 int main(int argc, char* argv[]) { |
| 397 google::SetUsageMessage(kUsageDescription); | 409 google::SetUsageMessage(kUsageDescription); |
| 398 google::ParseCommandLineFlags(&argc, &argv, true); | 410 google::ParseCommandLineFlags(&argc, &argv, true); |
| 399 | 411 |
| 400 SimulationSettings settings = CreateSettings(); | 412 SimulationSettings settings = CreateSettings(); |
| 401 PerformBasicParameterSanityChecks(settings); | 413 PerformBasicParameterSanityChecks(settings); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 | 446 |
| 435 return 0; | 447 return 0; |
| 436 } | 448 } |
| 437 | 449 |
| 438 } // namespace test | 450 } // namespace test |
| 439 } // namespace webrtc | 451 } // namespace webrtc |
| 440 | 452 |
| 441 int main(int argc, char* argv[]) { | 453 int main(int argc, char* argv[]) { |
| 442 return webrtc::test::main(argc, argv); | 454 return webrtc::test::main(argc, argv); |
| 443 } | 455 } |
| OLD | NEW |