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 MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_TIMING_H_ 12 #define MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_TIMING_H_ 13 14 #include <string> 15 #include <vector> 16 17 #include "api/array_view.h" 18 19 namespace webrtc { 20 namespace test { 21 namespace conversational_speech { 22 23 struct Turn { TurnTurn24 Turn(std::string new_speaker_name, 25 std::string new_audiotrack_file_name, 26 int new_offset, 27 int gain) 28 : speaker_name(new_speaker_name), 29 audiotrack_file_name(new_audiotrack_file_name), 30 offset(new_offset), 31 gain(gain) {} 32 bool operator==(const Turn& b) const; 33 std::string speaker_name; 34 std::string audiotrack_file_name; 35 int offset; 36 int gain; 37 }; 38 39 // Loads a list of turns from a file. 40 std::vector<Turn> LoadTiming(const std::string& timing_filepath); 41 42 // Writes a list of turns into a file. 43 void SaveTiming(const std::string& timing_filepath, 44 rtc::ArrayView<const Turn> timing); 45 46 } // namespace conversational_speech 47 } // namespace test 48 } // namespace webrtc 49 50 #endif // MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_TIMING_H_ 51