Index: webrtc/modules/audio_processing/aec3/comfort_noise_generator.cc |
diff --git a/webrtc/modules/audio_processing/aec3/comfort_noise_generator.cc b/webrtc/modules/audio_processing/aec3/comfort_noise_generator.cc |
index f630b25175eb3b22ef2ee3ee6cfa47f256a0434c..b8d7f28df6b402543fdda02d671b2983ddc319d1 100644 |
--- a/webrtc/modules/audio_processing/aec3/comfort_noise_generator.cc |
+++ b/webrtc/modules/audio_processing/aec3/comfort_noise_generator.cc |
@@ -188,6 +188,17 @@ void ComfortNoiseGenerator::Compute( |
} |
} |
+ // Limit the noise to a floor of -96 dBFS. |
+ constexpr float kNoiseFloor = 440.f; |
+ for (auto& n : N2_) { |
+ n = std::max(n, kNoiseFloor); |
+ } |
+ if (N2_initial_) { |
+ for (auto& n : *N2_initial_) { |
+ n = std::max(n, kNoiseFloor); |
+ } |
+ } |
+ |
// Choose N2 estimate to use. |
const std::array<float, kFftLengthBy2Plus1>& N2 = |
N2_initial_ ? *N2_initial_ : N2_; |