OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 if (public_submodules_->echo_control_mobile->is_enabled() && | 721 if (public_submodules_->echo_control_mobile->is_enabled() && |
722 public_submodules_->noise_suppression->is_enabled()) { | 722 public_submodules_->noise_suppression->is_enabled()) { |
723 ca->CopyLowPassToReference(); | 723 ca->CopyLowPassToReference(); |
724 } | 724 } |
725 public_submodules_->noise_suppression->ProcessCaptureAudio(ca); | 725 public_submodules_->noise_suppression->ProcessCaptureAudio(ca); |
726 if (capture_nonlocked_.intelligibility_enabled) { | 726 if (capture_nonlocked_.intelligibility_enabled) { |
727 RTC_DCHECK(public_submodules_->noise_suppression->is_enabled()); | 727 RTC_DCHECK(public_submodules_->noise_suppression->is_enabled()); |
728 int gain_db = public_submodules_->gain_control->is_enabled() ? | 728 int gain_db = public_submodules_->gain_control->is_enabled() ? |
729 public_submodules_->gain_control->compression_gain_db() : | 729 public_submodules_->gain_control->compression_gain_db() : |
730 0; | 730 0; |
| 731 float gain = std::pow(10.f, gain_db / 20.f); |
| 732 gain *= capture_nonlocked_.level_controller_enabled ? |
| 733 private_submodules_->level_controller->GetLastGain() : |
| 734 1.f; |
731 public_submodules_->intelligibility_enhancer->SetCaptureNoiseEstimate( | 735 public_submodules_->intelligibility_enhancer->SetCaptureNoiseEstimate( |
732 public_submodules_->noise_suppression->NoiseEstimate(), gain_db); | 736 public_submodules_->noise_suppression->NoiseEstimate(), gain); |
733 } | 737 } |
734 | 738 |
735 // Ensure that the stream delay was set before the call to the | 739 // Ensure that the stream delay was set before the call to the |
736 // AECM ProcessCaptureAudio function. | 740 // AECM ProcessCaptureAudio function. |
737 if (public_submodules_->echo_control_mobile->is_enabled() && | 741 if (public_submodules_->echo_control_mobile->is_enabled() && |
738 !was_stream_delay_set()) { | 742 !was_stream_delay_set()) { |
739 return AudioProcessing::kStreamParameterNotSetError; | 743 return AudioProcessing::kStreamParameterNotSetError; |
740 } | 744 } |
741 | 745 |
742 RETURN_ON_ERR(public_submodules_->echo_control_mobile->ProcessCaptureAudio( | 746 RETURN_ON_ERR(public_submodules_->echo_control_mobile->ProcessCaptureAudio( |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1482 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); | 1486 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); |
1483 | 1487 |
1484 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), | 1488 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), |
1485 &debug_dump_.num_bytes_left_for_log_, | 1489 &debug_dump_.num_bytes_left_for_log_, |
1486 &crit_debug_, &debug_dump_.capture)); | 1490 &crit_debug_, &debug_dump_.capture)); |
1487 return kNoError; | 1491 return kNoError; |
1488 } | 1492 } |
1489 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1493 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
1490 | 1494 |
1491 } // namespace webrtc | 1495 } // namespace webrtc |
OLD | NEW |