OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 in_file.FastForward(50); | 94 in_file.FastForward(50); |
95 | 95 |
96 PCMFile out_file; | 96 PCMFile out_file; |
97 if (append) { | 97 if (append) { |
98 out_file.Open(out_filename, kOutputFreqHz, "ab"); | 98 out_file.Open(out_filename, kOutputFreqHz, "ab"); |
99 } else { | 99 } else { |
100 out_file.Open(out_filename, kOutputFreqHz, "wb"); | 100 out_file.Open(out_filename, kOutputFreqHz, "wb"); |
101 } | 101 } |
102 | 102 |
103 uint16_t frame_size_samples = in_file.PayloadLength10Ms(); | 103 uint16_t frame_size_samples = in_file.PayloadLength10Ms(); |
104 uint32_t time_stamp = 0x12345678; | |
105 AudioFrame audio_frame; | 104 AudioFrame audio_frame; |
106 while (!in_file.EndOfFile()) { | 105 while (!in_file.EndOfFile()) { |
107 in_file.Read10MsData(audio_frame); | 106 in_file.Read10MsData(audio_frame); |
108 audio_frame.timestamp_ = time_stamp; | 107 audio_frame.timestamp_ = time_stamp_; |
109 time_stamp += frame_size_samples; | 108 time_stamp_ += frame_size_samples; |
110 EXPECT_GE(acm_send_->Add10MsData(audio_frame), 0); | 109 EXPECT_GE(acm_send_->Add10MsData(audio_frame), 0); |
111 bool muted; | 110 bool muted; |
112 acm_receive_->PlayoutData10Ms(kOutputFreqHz, &audio_frame, &muted); | 111 acm_receive_->PlayoutData10Ms(kOutputFreqHz, &audio_frame, &muted); |
113 ASSERT_FALSE(muted); | 112 ASSERT_FALSE(muted); |
114 out_file.Write10MsData(audio_frame); | 113 out_file.Write10MsData(audio_frame); |
115 } | 114 } |
116 | 115 |
117 in_file.Close(); | 116 in_file.Close(); |
118 out_file.Close(); | 117 out_file.Close(); |
119 | 118 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 | 268 |
270 EXPECT_EQ(0, acm_send_->EnableOpusDtx()); | 269 EXPECT_EQ(0, acm_send_->EnableOpusDtx()); |
271 | 270 |
272 expects[kEmptyFrame] = 1; | 271 expects[kEmptyFrame] = 1; |
273 Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"), | 272 Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"), |
274 32000, 2, out_filename, true, expects); | 273 32000, 2, out_filename, true, expects); |
275 #endif | 274 #endif |
276 } | 275 } |
277 | 276 |
278 } // namespace webrtc | 277 } // namespace webrtc |
OLD | NEW |