alessiob | 1d886dd | 2017-03-22 15:23:46 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_TIMING_H_ |
| 12 | #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_TIMING_H_ |
| 13 | |
| 14 | #include <string> |
| 15 | #include <vector> |
| 16 | |
kwiberg | 23aa43d | 2017-09-04 12:43:17 | [diff] [blame] | 17 | #include "webrtc/api/array_view.h" |
alessiob | 1d886dd | 2017-03-22 15:23:46 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | namespace test { |
| 21 | namespace conversational_speech { |
| 22 | |
| 23 | struct Turn{ |
| 24 | Turn(std::string new_speaker_name, std::string new_audiotrack_file_name, |
| 25 | int new_offset) |
| 26 | : speaker_name(new_speaker_name), |
| 27 | audiotrack_file_name(new_audiotrack_file_name), |
| 28 | offset(new_offset) {} |
| 29 | bool operator==(const Turn &b) const; |
| 30 | std::string speaker_name; |
| 31 | std::string audiotrack_file_name; |
| 32 | int offset; |
| 33 | }; |
| 34 | |
| 35 | // Loads a list of turns from a file. |
| 36 | std::vector<Turn> LoadTiming(const std::string& timing_filepath); |
| 37 | |
| 38 | // Writes a list of turns into a file. |
| 39 | void SaveTiming(const std::string& timing_filepath, |
| 40 | rtc::ArrayView<const Turn> timing); |
| 41 | |
| 42 | } // namespace conversational_speech |
| 43 | } // namespace test |
| 44 | } // namespace webrtc |
| 45 | |
| 46 | #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_TIMING_H_ |