Index: webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc |
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc |
index 33de5c1f954a99d0753d1f825b2e2cc91b72b961..c4c450f7768a86752c4d9a71e9ddddc5c0ae88bc 100644 |
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc |
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc |
@@ -109,8 +109,12 @@ IntelligibilityEnhancer::IntelligibilityEnhancer(int sample_rate_hz, |
} |
void IntelligibilityEnhancer::SetCaptureNoiseEstimate( |
- std::vector<float> noise) { |
+ std::vector<float> noise, int gain_db) { |
RTC_DCHECK_EQ(noise.size(), num_noise_bins_); |
+ float gain = std::pow(10.f, gain_db / 20.f); |
turaj
2016/04/25 13:51:13
suggestion: const float
aluebs-webrtc
2016/04/27 22:52:58
Totally!
|
+ for (size_t i = 0; i < noise.size(); ++i) { |
peah-webrtc
2016/04/25 07:23:20
Suggestion: You could use a foreach loop here.
aluebs-webrtc
2016/04/27 22:52:58
Done.
|
+ noise[i] *= gain; |
+ } |
// Disregarding return value since buffer overflow is acceptable, because it |
// is not critical to get each noise estimate. |
if (noise_estimation_queue_.Insert(&noise)) { |