Alex Loiko | e36e8bb | 2018-02-16 11:54:07 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 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_AGC2_FIXED_GAIN_CONTROLLER_H_ |
| 12 | #define MODULES_AUDIO_PROCESSING_AGC2_FIXED_GAIN_CONTROLLER_H_ |
| 13 | |
| 14 | #include "modules/audio_processing/include/audio_frame_view.h" |
| 15 | |
| 16 | namespace webrtc { |
| 17 | class ApmDataDumper; |
| 18 | |
| 19 | class FixedGainController { |
| 20 | public: |
| 21 | explicit FixedGainController(ApmDataDumper* apm_data_dumper); |
| 22 | |
| 23 | void Process(AudioFrameView<float> signal); |
| 24 | |
| 25 | void SetGain(float gain_to_apply_db); |
| 26 | void SetSampleRate(size_t sample_rate_hz); |
| 27 | void EnableLimiter(bool enable_limiter); |
| 28 | |
| 29 | private: |
| 30 | float gain_to_apply_ = 1.f; |
| 31 | ApmDataDumper* apm_data_dumper_; |
| 32 | bool enable_limiter_ = true; |
| 33 | }; |
| 34 | |
| 35 | } // namespace webrtc |
| 36 | |
| 37 | #endif // MODULES_AUDIO_PROCESSING_AGC2_FIXED_GAIN_CONTROLLER_H_ |