OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2016 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_LEVEL_CONTROLLER_LEVEL_CONTROLLER_H_ | |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_CONTROLLER_LEVEL_CONTROLLER_H_ | |
13 | |
14 #include <memory> | |
15 #include <vector> | |
16 | |
17 #include "webrtc/base/constructormagic.h" | |
18 #include "webrtc/base/optional.h" | |
19 #include "webrtc/modules/audio_processing/level_controller/gain_applier.h" | |
20 #include "webrtc/modules/audio_processing/level_controller/noise_level_estimator .h" | |
21 #include "webrtc/modules/audio_processing/level_controller/peak_level_estimator. h" | |
22 #include "webrtc/modules/audio_processing/level_controller/saturating_gain_estim ator.h" | |
23 #include "webrtc/modules/audio_processing/level_controller/signal_classifier.h" | |
24 #include "webrtc/modules/audio_processing/level_controller/gain_selector.h" | |
hlundin-webrtc
2016/06/28 11:29:01
Order is wrong; gain_selector.h should go higher u
peah-webrtc
2016/06/28 22:19:38
Done.
| |
25 | |
26 namespace webrtc { | |
27 | |
28 class ApmDataDumper; | |
29 class AudioBuffer; | |
30 | |
31 class LevelController { | |
32 public: | |
33 LevelController(); | |
34 ~LevelController(); | |
35 | |
36 void Initialize(int sample_rate_hz); | |
37 void Process(AudioBuffer* audio); | |
38 | |
39 private: | |
40 std::unique_ptr<ApmDataDumper> data_dumper_; | |
41 GainSelector gain_selector_; | |
42 GainApplier gain_applier_; | |
43 SignalClassifier signal_classifier_; | |
44 NoiseLevelEstimator noise_level_estimator_; | |
45 PeakLevelEstimator peak_level_estimator_; | |
46 SaturatingGainEstimator saturating_gain_estimator_; | |
47 rtc::Optional<int> sample_rate_hz_; | |
48 static int instance_count_; | |
49 float dc_level_[2]; | |
50 float dc_forgetting_factor_ = 0.f; | |
51 | |
52 RTC_DISALLOW_COPY_AND_ASSIGN(LevelController); | |
53 }; | |
54 | |
55 } // namespace webrtc | |
56 | |
57 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_CONTROLLER_LEVEL_CONTROLLER_H_ | |
OLD | NEW |