OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 35 matching lines...) Loading... |
46 timing.push_back(parse_line(line)); | 46 timing.push_back(parse_line(line)); |
47 } | 47 } |
48 infile.close(); | 48 infile.close(); |
49 | 49 |
50 return timing; | 50 return timing; |
51 } | 51 } |
52 | 52 |
53 void SaveTiming(const std::string& timing_filepath, | 53 void SaveTiming(const std::string& timing_filepath, |
54 rtc::ArrayView<const Turn> timing) { | 54 rtc::ArrayView<const Turn> timing) { |
55 std::ofstream outfile(timing_filepath); | 55 std::ofstream outfile(timing_filepath); |
56 // TODO(alessio): check if file open for writing. | 56 RTC_CHECK(outfile.is_open()); |
57 for (const Turn& turn : timing) { | 57 for (const Turn& turn : timing) { |
58 outfile << turn.speaker_name << " " << turn.audiotrack_file_name | 58 outfile << turn.speaker_name << " " << turn.audiotrack_file_name |
59 << " " << turn.offset << std::endl; | 59 << " " << turn.offset << std::endl; |
60 } | 60 } |
61 outfile.close(); | 61 outfile.close(); |
62 } | 62 } |
63 | 63 |
64 } // namespace conversational_speech | 64 } // namespace conversational_speech |
65 } // namespace test | 65 } // namespace test |
66 } // namespace webrtc | 66 } // namespace webrtc |
OLD | NEW |