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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // streams. | 152 // streams. |
153 // | 153 // |
154 // Thread safety is provided with the following assumptions to reduce locking | 154 // Thread safety is provided with the following assumptions to reduce locking |
155 // overhead: | 155 // overhead: |
156 // 1. The stream getters and setters are called from the same thread as | 156 // 1. The stream getters and setters are called from the same thread as |
157 // ProcessStream(). More precisely, stream functions are never called | 157 // ProcessStream(). More precisely, stream functions are never called |
158 // concurrently with ProcessStream(). | 158 // concurrently with ProcessStream(). |
159 // 2. Parameter getters are never called concurrently with the corresponding | 159 // 2. Parameter getters are never called concurrently with the corresponding |
160 // setter. | 160 // setter. |
161 // | 161 // |
162 // APM accepts only linear PCM audio data in chunks of 10 ms. The int16 | 162 // APM accepts only linear PCM audio data in chunks of 10 ms. The int16_t |
163 // interfaces use interleaved data, while the float interfaces use deinterleaved | 163 // interfaces use interleaved data, while the float interfaces use deinterleaved |
164 // data. | 164 // data. |
165 // | 165 // |
166 // Usage example, omitting error checking: | 166 // Usage example, omitting error checking: |
167 // AudioProcessing* apm = AudioProcessing::Create(0); | 167 // AudioProcessing* apm = AudioProcessing::Create(0); |
168 // | 168 // |
169 // apm->high_pass_filter()->Enable(true); | 169 // apm->high_pass_filter()->Enable(true); |
170 // | 170 // |
171 // apm->echo_cancellation()->enable_drift_compensation(false); | 171 // apm->echo_cancellation()->enable_drift_compensation(false); |
172 // apm->echo_cancellation()->Enable(true); | 172 // apm->echo_cancellation()->Enable(true); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // should be called before beginning to process a new audio stream. However, | 233 // should be called before beginning to process a new audio stream. However, |
234 // it is not necessary to call before processing the first stream after | 234 // it is not necessary to call before processing the first stream after |
235 // creation. | 235 // creation. |
236 // | 236 // |
237 // It is also not necessary to call if the audio parameters (sample | 237 // It is also not necessary to call if the audio parameters (sample |
238 // rate and number of channels) have changed. Passing updated parameters | 238 // rate and number of channels) have changed. Passing updated parameters |
239 // directly to |ProcessStream()| and |AnalyzeReverseStream()| is permissible. | 239 // directly to |ProcessStream()| and |AnalyzeReverseStream()| is permissible. |
240 // If the parameters are known at init-time though, they may be provided. | 240 // If the parameters are known at init-time though, they may be provided. |
241 virtual int Initialize() = 0; | 241 virtual int Initialize() = 0; |
242 | 242 |
243 // The int16 interfaces require: | 243 // The int16_t interfaces require: |
244 // - only |NativeRate|s be used | 244 // - only |NativeRate|s be used |
245 // - that the input, output and reverse rates must match | 245 // - that the input, output and reverse rates must match |
246 // - that |processing_config.output_stream()| matches | 246 // - that |processing_config.output_stream()| matches |
247 // |processing_config.input_stream()|. | 247 // |processing_config.input_stream()|. |
248 // | 248 // |
249 // The float interfaces accept arbitrary rates and support differing input and | 249 // The float interfaces accept arbitrary rates and support differing input and |
250 // output layouts, but the output must have either one channel or the same | 250 // output layouts, but the output must have either one channel or the same |
251 // number of channels as the input. | 251 // number of channels as the input. |
252 virtual int Initialize(const ProcessingConfig& processing_config) = 0; | 252 virtual int Initialize(const ProcessingConfig& processing_config) = 0; |
253 | 253 |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 // This does not impact the size of frames passed to |ProcessStream()|. | 936 // This does not impact the size of frames passed to |ProcessStream()|. |
937 virtual int set_frame_size_ms(int size) = 0; | 937 virtual int set_frame_size_ms(int size) = 0; |
938 virtual int frame_size_ms() const = 0; | 938 virtual int frame_size_ms() const = 0; |
939 | 939 |
940 protected: | 940 protected: |
941 virtual ~VoiceDetection() {} | 941 virtual ~VoiceDetection() {} |
942 }; | 942 }; |
943 } // namespace webrtc | 943 } // namespace webrtc |
944 | 944 |
945 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 945 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
OLD | NEW |