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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // AGC moves the microphone volume up to |startup_min_volume| if the current | 107 // AGC moves the microphone volume up to |startup_min_volume| if the current |
108 // microphone volume is set too low. The value is clamped to its operating range | 108 // microphone volume is set too low. The value is clamped to its operating range |
109 // [12, 255]. Here, 255 maps to 100%. | 109 // [12, 255]. Here, 255 maps to 100%. |
110 // | 110 // |
111 // Must be provided through AudioProcessing::Create(Confg&). | 111 // Must be provided through AudioProcessing::Create(Confg&). |
112 #if defined(WEBRTC_CHROMIUM_BUILD) | 112 #if defined(WEBRTC_CHROMIUM_BUILD) |
113 static const int kAgcStartupMinVolume = 85; | 113 static const int kAgcStartupMinVolume = 85; |
114 #else | 114 #else |
115 static const int kAgcStartupMinVolume = 0; | 115 static const int kAgcStartupMinVolume = 0; |
116 #endif // defined(WEBRTC_CHROMIUM_BUILD) | 116 #endif // defined(WEBRTC_CHROMIUM_BUILD) |
| 117 static constexpr int kClippedLevelMin = 170; |
117 struct ExperimentalAgc { | 118 struct ExperimentalAgc { |
118 ExperimentalAgc() : enabled(true), startup_min_volume(kAgcStartupMinVolume) {} | 119 ExperimentalAgc() = default; |
119 explicit ExperimentalAgc(bool enabled) | 120 explicit ExperimentalAgc(bool enabled) : enabled(enabled) {} |
120 : enabled(enabled), startup_min_volume(kAgcStartupMinVolume) {} | |
121 ExperimentalAgc(bool enabled, int startup_min_volume) | 121 ExperimentalAgc(bool enabled, int startup_min_volume) |
122 : enabled(enabled), startup_min_volume(startup_min_volume) {} | 122 : enabled(enabled), startup_min_volume(startup_min_volume) {} |
| 123 ExperimentalAgc(bool enabled, int startup_min_volume, int clipped_level_min) |
| 124 : enabled(enabled), |
| 125 startup_min_volume(startup_min_volume), |
| 126 clipped_level_min(clipped_level_min) {} |
123 static const ConfigOptionID identifier = ConfigOptionID::kExperimentalAgc; | 127 static const ConfigOptionID identifier = ConfigOptionID::kExperimentalAgc; |
124 bool enabled; | 128 bool enabled = true; |
125 int startup_min_volume; | 129 int startup_min_volume = kAgcStartupMinVolume; |
| 130 // Lowest microphone level that will be applied in response to clipping. |
| 131 int clipped_level_min = kClippedLevelMin; |
126 }; | 132 }; |
127 | 133 |
128 // Use to enable experimental noise suppression. It can be set in the | 134 // Use to enable experimental noise suppression. It can be set in the |
129 // constructor or using AudioProcessing::SetExtraOptions(). | 135 // constructor or using AudioProcessing::SetExtraOptions(). |
130 struct ExperimentalNs { | 136 struct ExperimentalNs { |
131 ExperimentalNs() : enabled(false) {} | 137 ExperimentalNs() : enabled(false) {} |
132 explicit ExperimentalNs(bool enabled) : enabled(enabled) {} | 138 explicit ExperimentalNs(bool enabled) : enabled(enabled) {} |
133 static const ConfigOptionID identifier = ConfigOptionID::kExperimentalNs; | 139 static const ConfigOptionID identifier = ConfigOptionID::kExperimentalNs; |
134 bool enabled; | 140 bool enabled; |
135 }; | 141 }; |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 // This does not impact the size of frames passed to |ProcessStream()|. | 1081 // This does not impact the size of frames passed to |ProcessStream()|. |
1076 virtual int set_frame_size_ms(int size) = 0; | 1082 virtual int set_frame_size_ms(int size) = 0; |
1077 virtual int frame_size_ms() const = 0; | 1083 virtual int frame_size_ms() const = 0; |
1078 | 1084 |
1079 protected: | 1085 protected: |
1080 virtual ~VoiceDetection() {} | 1086 virtual ~VoiceDetection() {} |
1081 }; | 1087 }; |
1082 } // namespace webrtc | 1088 } // namespace webrtc |
1083 | 1089 |
1084 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 1090 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
OLD | NEW |