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 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 | 13 |
| 14 #include "webrtc/base/array_view.h" |
| 15 #include "webrtc/modules/audio_processing/audio_buffer.h" |
| 16 #include "webrtc/modules/audio_processing/agc2/gain_controller2.h" |
14 #include "webrtc/modules/audio_processing/agc2/digital_gain_applier.h" | 17 #include "webrtc/modules/audio_processing/agc2/digital_gain_applier.h" |
15 #include "webrtc/modules/audio_processing/agc2/gain_controller2.h" | |
16 #include "webrtc/modules/audio_processing/audio_buffer.h" | |
17 #include "webrtc/rtc_base/array_view.h" | |
18 #include "webrtc/test/gtest.h" | 18 #include "webrtc/test/gtest.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 namespace test { | 21 namespace test { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 constexpr size_t kNumFrames = 480u; | 25 constexpr size_t kNumFrames = 480u; |
26 constexpr size_t kStereo = 2u; | 26 constexpr size_t kStereo = 2u; |
27 | 27 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 std::unique_ptr<GainController2> gain_controller2; | 90 std::unique_ptr<GainController2> gain_controller2; |
91 gain_controller2.reset(new GainController2( | 91 gain_controller2.reset(new GainController2( |
92 AudioProcessing::kSampleRate48kHz)); | 92 AudioProcessing::kSampleRate48kHz)); |
93 AudioBuffer ab(kNumFrames, kStereo, kNumFrames, kStereo, kNumFrames); | 93 AudioBuffer ab(kNumFrames, kStereo, kNumFrames, kStereo, kNumFrames); |
94 SetAudioBufferSamples(1000.0f, &ab); | 94 SetAudioBufferSamples(1000.0f, &ab); |
95 gain_controller2->Process(&ab); | 95 gain_controller2->Process(&ab); |
96 } | 96 } |
97 | 97 |
98 } // namespace test | 98 } // namespace test |
99 } // namespace webrtc | 99 } // namespace webrtc |
OLD | NEW |