Add decibel conversion functions to //common_audio:common_audio
The functions replace some existing code and will be used in the the new AutomaticGainController. Bug: webrtc:7949 Change-Id: I9a32132d4a4699a507b8548a2eac10972a2f3fd6 Reviewed-on: https://webrtc-review.googlesource.com/53141 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Alex Loiko <aleloi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22045}
This commit is contained in:
@ -1262,7 +1262,7 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
|
||||
int gain_db = public_submodules_->gain_control->is_enabled() ?
|
||||
public_submodules_->gain_control->compression_gain_db() :
|
||||
0;
|
||||
float gain = std::pow(10.f, gain_db / 20.f);
|
||||
float gain = DbToRatio(gain_db);
|
||||
gain *= capture_nonlocked_.level_controller_enabled ?
|
||||
private_submodules_->level_controller->GetLastGain() :
|
||||
1.f;
|
||||
|
Reference in New Issue
Block a user