mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 22:00:47 +01:00

This CL adds functionality that allows adjusting the audio levels internally in APM. The main purpose of the functionality is to allow APM to optionally be moved to an integration that does not provide an analog gain to control, and the implementation of this has been tailored specifically to meet the requirements for that. More specifically, this CL does -Add a new variant of the pre-amplifier gain that is intended to replace the pre-amplifier gain (but at the moment can coexist with that). The main differences with the pre-amplifier gain is that an attenuating gain is allowed, the gain is applied jointly with any emulated analog gain, and that its packaging fits better with the post gain. -Add an emulation of an analog microphone gain. The emulation is designed to match the analog mic gain functionality in Chrome OS (which is digital) but should be usable also on other platforms. -Add a post-gain which is applied after all processing has been applied. The purpose of this gain is for it to work well with the integration in ChromeOS, and be used to compensate for the offset that there is applied on some USB audio devices. Bug: b/177830918 Change-Id: I0f312996e4088c9bd242a713a703eaaeb17f188a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209707 Commit-Queue: Per Åhgren <peah@webrtc.org> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33466}
45 lines
1.1 KiB
Text
45 lines
1.1 KiB
Text
# Copyright (c) 2021 The WebRTC project authors. All Rights Reserved.
|
|
#
|
|
# Use of this source code is governed by a BSD-style license
|
|
# that can be found in the LICENSE file in the root of the source
|
|
# tree. An additional intellectual property rights grant can be found
|
|
# in the file PATENTS. All contributing project authors may
|
|
# be found in the AUTHORS file in the root of the source tree.
|
|
|
|
import("../../../webrtc.gni")
|
|
|
|
rtc_library("capture_levels_adjuster") {
|
|
visibility = [ "*" ]
|
|
|
|
sources = [
|
|
"audio_samples_scaler.cc",
|
|
"audio_samples_scaler.h",
|
|
"capture_levels_adjuster.cc",
|
|
"capture_levels_adjuster.h",
|
|
]
|
|
|
|
defines = []
|
|
|
|
deps = [
|
|
"..:audio_buffer",
|
|
"../../../api:array_view",
|
|
"../../../rtc_base:checks",
|
|
"../../../rtc_base:safe_minmax",
|
|
]
|
|
}
|
|
|
|
rtc_library("capture_levels_adjuster_unittests") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"audio_samples_scaler_unittest.cc",
|
|
"capture_levels_adjuster_unittest.cc",
|
|
]
|
|
deps = [
|
|
":capture_levels_adjuster",
|
|
"..:audioproc_test_utils",
|
|
"../../../rtc_base:gunit_helpers",
|
|
"../../../rtc_base:stringutils",
|
|
"../../../test:test_support",
|
|
]
|
|
}
|