| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // sufficiently unreliable. See WEBRTC_UNTRUSTED_DELAY in echo_cancellation.c. | 58 // sufficiently unreliable. See WEBRTC_UNTRUSTED_DELAY in echo_cancellation.c. |
| 59 // - Faster startup times by removing the excessive "startup phase" processing | 59 // - Faster startup times by removing the excessive "startup phase" processing |
| 60 // of reported delays. | 60 // of reported delays. |
| 61 // - Much more conservative adjustments to the far-end read pointer. We smooth | 61 // - Much more conservative adjustments to the far-end read pointer. We smooth |
| 62 // the delay difference more heavily, and back off from the difference more. | 62 // the delay difference more heavily, and back off from the difference more. |
| 63 // Adjustments force a readaptation of the filter, so they should be avoided | 63 // Adjustments force a readaptation of the filter, so they should be avoided |
| 64 // except when really necessary. | 64 // except when really necessary. |
| 65 struct ExtendedFilter { | 65 struct ExtendedFilter { |
| 66 ExtendedFilter() : enabled(false) {} | 66 ExtendedFilter() : enabled(false) {} |
| 67 explicit ExtendedFilter(bool enabled) : enabled(enabled) {} | 67 explicit ExtendedFilter(bool enabled) : enabled(enabled) {} |
| 68 static const ConfigOptionID identifier = ConfigOptionID::kExtendedFilter; |
| 68 bool enabled; | 69 bool enabled; |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 // Enables delay-agnostic echo cancellation. This feature relies on internally | 72 // Enables delay-agnostic echo cancellation. This feature relies on internally |
| 72 // estimated delays between the process and reverse streams, thus not relying | 73 // estimated delays between the process and reverse streams, thus not relying |
| 73 // on reported system delays. This configuration only applies to | 74 // on reported system delays. This configuration only applies to |
| 74 // EchoCancellation and not EchoControlMobile. It can be set in the constructor | 75 // EchoCancellation and not EchoControlMobile. It can be set in the constructor |
| 75 // or using AudioProcessing::SetExtraOptions(). | 76 // or using AudioProcessing::SetExtraOptions(). |
| 76 struct DelayAgnostic { | 77 struct DelayAgnostic { |
| 77 DelayAgnostic() : enabled(false) {} | 78 DelayAgnostic() : enabled(false) {} |
| 78 explicit DelayAgnostic(bool enabled) : enabled(enabled) {} | 79 explicit DelayAgnostic(bool enabled) : enabled(enabled) {} |
| 80 static const ConfigOptionID identifier = ConfigOptionID::kDelayAgnostic; |
| 79 bool enabled; | 81 bool enabled; |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 // Use to enable experimental gain control (AGC). At startup the experimental | 84 // Use to enable experimental gain control (AGC). At startup the experimental |
| 83 // AGC moves the microphone volume up to |startup_min_volume| if the current | 85 // AGC moves the microphone volume up to |startup_min_volume| if the current |
| 84 // microphone volume is set too low. The value is clamped to its operating range | 86 // microphone volume is set too low. The value is clamped to its operating range |
| 85 // [12, 255]. Here, 255 maps to 100%. | 87 // [12, 255]. Here, 255 maps to 100%. |
| 86 // | 88 // |
| 87 // Must be provided through AudioProcessing::Create(Confg&). | 89 // Must be provided through AudioProcessing::Create(Confg&). |
| 88 #if defined(WEBRTC_CHROMIUM_BUILD) | 90 #if defined(WEBRTC_CHROMIUM_BUILD) |
| 89 static const int kAgcStartupMinVolume = 85; | 91 static const int kAgcStartupMinVolume = 85; |
| 90 #else | 92 #else |
| 91 static const int kAgcStartupMinVolume = 0; | 93 static const int kAgcStartupMinVolume = 0; |
| 92 #endif // defined(WEBRTC_CHROMIUM_BUILD) | 94 #endif // defined(WEBRTC_CHROMIUM_BUILD) |
| 93 struct ExperimentalAgc { | 95 struct ExperimentalAgc { |
| 94 ExperimentalAgc() : enabled(true), startup_min_volume(kAgcStartupMinVolume) {} | 96 ExperimentalAgc() : enabled(true), startup_min_volume(kAgcStartupMinVolume) {} |
| 95 explicit ExperimentalAgc(bool enabled) | 97 explicit ExperimentalAgc(bool enabled) |
| 96 : enabled(enabled), startup_min_volume(kAgcStartupMinVolume) {} | 98 : enabled(enabled), startup_min_volume(kAgcStartupMinVolume) {} |
| 97 ExperimentalAgc(bool enabled, int startup_min_volume) | 99 ExperimentalAgc(bool enabled, int startup_min_volume) |
| 98 : enabled(enabled), startup_min_volume(startup_min_volume) {} | 100 : enabled(enabled), startup_min_volume(startup_min_volume) {} |
| 101 static const ConfigOptionID identifier = ConfigOptionID::kExperimentalAgc; |
| 99 bool enabled; | 102 bool enabled; |
| 100 int startup_min_volume; | 103 int startup_min_volume; |
| 101 }; | 104 }; |
| 102 | 105 |
| 103 // Use to enable experimental noise suppression. It can be set in the | 106 // Use to enable experimental noise suppression. It can be set in the |
| 104 // constructor or using AudioProcessing::SetExtraOptions(). | 107 // constructor or using AudioProcessing::SetExtraOptions(). |
| 105 struct ExperimentalNs { | 108 struct ExperimentalNs { |
| 106 ExperimentalNs() : enabled(false) {} | 109 ExperimentalNs() : enabled(false) {} |
| 107 explicit ExperimentalNs(bool enabled) : enabled(enabled) {} | 110 explicit ExperimentalNs(bool enabled) : enabled(enabled) {} |
| 111 static const ConfigOptionID identifier = ConfigOptionID::kExperimentalNs; |
| 108 bool enabled; | 112 bool enabled; |
| 109 }; | 113 }; |
| 110 | 114 |
| 111 // Use to enable beamforming. Must be provided through the constructor. It will | 115 // Use to enable beamforming. Must be provided through the constructor. It will |
| 112 // have no impact if used with AudioProcessing::SetExtraOptions(). | 116 // have no impact if used with AudioProcessing::SetExtraOptions(). |
| 113 struct Beamforming { | 117 struct Beamforming { |
| 114 Beamforming() | 118 Beamforming() |
| 115 : enabled(false), | 119 : enabled(false), |
| 116 array_geometry(), | 120 array_geometry(), |
| 117 target_direction( | 121 target_direction( |
| 118 SphericalPointf(static_cast<float>(M_PI) / 2.f, 0.f, 1.f)) {} | 122 SphericalPointf(static_cast<float>(M_PI) / 2.f, 0.f, 1.f)) {} |
| 119 Beamforming(bool enabled, const std::vector<Point>& array_geometry) | 123 Beamforming(bool enabled, const std::vector<Point>& array_geometry) |
| 120 : Beamforming(enabled, | 124 : Beamforming(enabled, |
| 121 array_geometry, | 125 array_geometry, |
| 122 SphericalPointf(static_cast<float>(M_PI) / 2.f, 0.f, 1.f)) { | 126 SphericalPointf(static_cast<float>(M_PI) / 2.f, 0.f, 1.f)) { |
| 123 } | 127 } |
| 124 Beamforming(bool enabled, | 128 Beamforming(bool enabled, |
| 125 const std::vector<Point>& array_geometry, | 129 const std::vector<Point>& array_geometry, |
| 126 SphericalPointf target_direction) | 130 SphericalPointf target_direction) |
| 127 : enabled(enabled), | 131 : enabled(enabled), |
| 128 array_geometry(array_geometry), | 132 array_geometry(array_geometry), |
| 129 target_direction(target_direction) {} | 133 target_direction(target_direction) {} |
| 134 static const ConfigOptionID identifier = ConfigOptionID::kBeamforming; |
| 130 const bool enabled; | 135 const bool enabled; |
| 131 const std::vector<Point> array_geometry; | 136 const std::vector<Point> array_geometry; |
| 132 const SphericalPointf target_direction; | 137 const SphericalPointf target_direction; |
| 133 }; | 138 }; |
| 134 | 139 |
| 135 // Use to enable intelligibility enhancer in audio processing. Must be provided | 140 // Use to enable intelligibility enhancer in audio processing. Must be provided |
| 136 // though the constructor. It will have no impact if used with | 141 // though the constructor. It will have no impact if used with |
| 137 // AudioProcessing::SetExtraOptions(). | 142 // AudioProcessing::SetExtraOptions(). |
| 138 // | 143 // |
| 139 // Note: If enabled and the reverse stream has more than one output channel, | 144 // Note: If enabled and the reverse stream has more than one output channel, |
| 140 // the reverse stream will become an upmixed mono signal. | 145 // the reverse stream will become an upmixed mono signal. |
| 141 struct Intelligibility { | 146 struct Intelligibility { |
| 142 Intelligibility() : enabled(false) {} | 147 Intelligibility() : enabled(false) {} |
| 143 explicit Intelligibility(bool enabled) : enabled(enabled) {} | 148 explicit Intelligibility(bool enabled) : enabled(enabled) {} |
| 149 static const ConfigOptionID identifier = ConfigOptionID::kIntelligibility; |
| 144 bool enabled; | 150 bool enabled; |
| 145 }; | 151 }; |
| 146 | 152 |
| 147 // The Audio Processing Module (APM) provides a collection of voice processing | 153 // The Audio Processing Module (APM) provides a collection of voice processing |
| 148 // components designed for real-time communications software. | 154 // components designed for real-time communications software. |
| 149 // | 155 // |
| 150 // APM operates on two audio streams on a frame-by-frame basis. Frames of the | 156 // APM operates on two audio streams on a frame-by-frame basis. Frames of the |
| 151 // primary stream, on which all processing is applied, are passed to | 157 // primary stream, on which all processing is applied, are passed to |
| 152 // |ProcessStream()|. Frames of the reverse direction stream, which are used for | 158 // |ProcessStream()|. Frames of the reverse direction stream, which are used for |
| 153 // analysis by some components, are passed to |AnalyzeReverseStream()|. On the | 159 // analysis by some components, are passed to |AnalyzeReverseStream()|. On the |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 // This does not impact the size of frames passed to |ProcessStream()|. | 955 // This does not impact the size of frames passed to |ProcessStream()|. |
| 950 virtual int set_frame_size_ms(int size) = 0; | 956 virtual int set_frame_size_ms(int size) = 0; |
| 951 virtual int frame_size_ms() const = 0; | 957 virtual int frame_size_ms() const = 0; |
| 952 | 958 |
| 953 protected: | 959 protected: |
| 954 virtual ~VoiceDetection() {} | 960 virtual ~VoiceDetection() {} |
| 955 }; | 961 }; |
| 956 } // namespace webrtc | 962 } // namespace webrtc |
| 957 | 963 |
| 958 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 964 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
| OLD | NEW |