| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // It gets an audio file, and its voice gain information, and the suppressor | 143 // It gets an audio file, and its voice gain information, and the suppressor |
| 144 // process it giving the output file "suppressed_keystrokes.pcm". | 144 // process it giving the output file "suppressed_keystrokes.pcm". |
| 145 void void_main() { | 145 void void_main() { |
| 146 // TODO(aluebs): Remove all FileWrappers. | 146 // TODO(aluebs): Remove all FileWrappers. |
| 147 // Prepare the input file. | 147 // Prepare the input file. |
| 148 FILE* in_file = fopen(FLAGS_in_file_name.c_str(), "rb"); | 148 FILE* in_file = fopen(FLAGS_in_file_name.c_str(), "rb"); |
| 149 ASSERT_TRUE(in_file != NULL); | 149 ASSERT_TRUE(in_file != NULL); |
| 150 | 150 |
| 151 // Prepare the detection file. | 151 // Prepare the detection file. |
| 152 FILE* detection_file = NULL; | 152 FILE* detection_file = NULL; |
| 153 if (FLAGS_detection_file_name != "") { | 153 if (!FLAGS_detection_file_name.empty()) { |
| 154 detection_file = fopen(FLAGS_detection_file_name.c_str(), "rb"); | 154 detection_file = fopen(FLAGS_detection_file_name.c_str(), "rb"); |
| 155 } | 155 } |
| 156 | 156 |
| 157 // Prepare the reference file. | 157 // Prepare the reference file. |
| 158 FILE* reference_file = NULL; | 158 FILE* reference_file = NULL; |
| 159 if (FLAGS_reference_file_name != "") { | 159 if (!FLAGS_reference_file_name.empty()) { |
| 160 reference_file = fopen(FLAGS_reference_file_name.c_str(), "rb"); | 160 reference_file = fopen(FLAGS_reference_file_name.c_str(), "rb"); |
| 161 } | 161 } |
| 162 | 162 |
| 163 // Prepare the output file. | 163 // Prepare the output file. |
| 164 std::string out_file_name = test::OutputPath() + "suppressed_keystrokes.pcm"; | 164 std::string out_file_name = test::OutputPath() + "suppressed_keystrokes.pcm"; |
| 165 FILE* out_file = fopen(out_file_name.c_str(), "wb"); | 165 FILE* out_file = fopen(out_file_name.c_str(), "wb"); |
| 166 ASSERT_TRUE(out_file != NULL); | 166 ASSERT_TRUE(out_file != NULL); |
| 167 | 167 |
| 168 int detection_rate_hz = FLAGS_detection_rate_hz; | 168 int detection_rate_hz = FLAGS_detection_rate_hz; |
| 169 if (detection_rate_hz == 0) { | 169 if (detection_rate_hz == 0) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace webrtc | 243 } // namespace webrtc |
| 244 | 244 |
| 245 int main(int argc, char* argv[]) { | 245 int main(int argc, char* argv[]) { |
| 246 google::SetUsageMessage(webrtc::kUsage); | 246 google::SetUsageMessage(webrtc::kUsage); |
| 247 google::ParseCommandLineFlags(&argc, &argv, true); | 247 google::ParseCommandLineFlags(&argc, &argv, true); |
| 248 webrtc::void_main(); | 248 webrtc::void_main(); |
| 249 return 0; | 249 return 0; |
| 250 } | 250 } |
| OLD | NEW |