| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 17 matching lines...) Expand all Loading... |
| 28 using testing::_; | 28 using testing::_; |
| 29 using testing::Exactly; | 29 using testing::Exactly; |
| 30 using testing::Invoke; | 30 using testing::Invoke; |
| 31 using testing::Return; | 31 using testing::Return; |
| 32 | 32 |
| 33 namespace webrtc { | 33 namespace webrtc { |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 constexpr int kDefaultSampleRateHz = 48000; | 37 constexpr int kDefaultSampleRateHz = 48000; |
| 38 constexpr int kId = 1; |
| 38 | 39 |
| 39 // Utility function that resets the frame member variables with | 40 // Utility function that resets the frame member variables with |
| 40 // sensible defaults. | 41 // sensible defaults. |
| 41 void ResetFrame(AudioFrame* frame) { | 42 void ResetFrame(AudioFrame* frame) { |
| 43 frame->id_ = kId; |
| 42 frame->sample_rate_hz_ = kDefaultSampleRateHz; | 44 frame->sample_rate_hz_ = kDefaultSampleRateHz; |
| 43 frame->num_channels_ = 1; | 45 frame->num_channels_ = 1; |
| 44 | 46 |
| 45 // Frame duration 10ms. | 47 // Frame duration 10ms. |
| 46 frame->samples_per_channel_ = kDefaultSampleRateHz / 100; | 48 frame->samples_per_channel_ = kDefaultSampleRateHz / 100; |
| 47 frame->vad_activity_ = AudioFrame::kVadActive; | 49 frame->vad_activity_ = AudioFrame::kVadActive; |
| 48 frame->speech_type_ = AudioFrame::kNormalSpeech; | 50 frame->speech_type_ = AudioFrame::kNormalSpeech; |
| 49 } | 51 } |
| 50 | 52 |
| 51 std::string ProduceDebugText(int sample_rate_hz, | 53 std::string ProduceDebugText(int sample_rate_hz, |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 } | 536 } |
| 535 | 537 |
| 536 mixer->Mix(number_of_channels, &frame_for_mixing); | 538 mixer->Mix(number_of_channels, &frame_for_mixing); |
| 537 EXPECT_EQ(rate, frame_for_mixing.sample_rate_hz_); | 539 EXPECT_EQ(rate, frame_for_mixing.sample_rate_hz_); |
| 538 EXPECT_EQ(number_of_channels, frame_for_mixing.num_channels_); | 540 EXPECT_EQ(number_of_channels, frame_for_mixing.num_channels_); |
| 539 } | 541 } |
| 540 } | 542 } |
| 541 } | 543 } |
| 542 } | 544 } |
| 543 } // namespace webrtc | 545 } // namespace webrtc |
| OLD | NEW |