| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 int output_sample_rate_hz, | 257 int output_sample_rate_hz, |
| 258 int reverse_sample_rate_hz, | 258 int reverse_sample_rate_hz, |
| 259 ChannelLayout input_layout, | 259 ChannelLayout input_layout, |
| 260 ChannelLayout output_layout, | 260 ChannelLayout output_layout, |
| 261 ChannelLayout reverse_layout) = 0; | 261 ChannelLayout reverse_layout) = 0; |
| 262 | 262 |
| 263 // Pass down additional options which don't have explicit setters. This | 263 // Pass down additional options which don't have explicit setters. This |
| 264 // ensures the options are applied immediately. | 264 // ensures the options are applied immediately. |
| 265 virtual void SetExtraOptions(const Config& config) = 0; | 265 virtual void SetExtraOptions(const Config& config) = 0; |
| 266 | 266 |
| 267 // DEPRECATED. | |
| 268 // TODO(ajm): Remove after Chromium has upgraded to using Initialize(). | |
| 269 virtual int set_sample_rate_hz(int rate) = 0; | |
| 270 // TODO(ajm): Remove after voice engine no longer requires it to resample | |
| 271 // the reverse stream to the forward rate. | |
| 272 virtual int input_sample_rate_hz() const = 0; | |
| 273 // TODO(ajm): Remove after Chromium no longer depends on it. | |
| 274 virtual int sample_rate_hz() const = 0; | |
| 275 | |
| 276 // TODO(ajm): Only intended for internal use. Make private and friend the | 267 // TODO(ajm): Only intended for internal use. Make private and friend the |
| 277 // necessary classes? | 268 // necessary classes? |
| 278 virtual int proc_sample_rate_hz() const = 0; | 269 virtual int proc_sample_rate_hz() const = 0; |
| 279 virtual int proc_split_sample_rate_hz() const = 0; | 270 virtual int proc_split_sample_rate_hz() const = 0; |
| 280 virtual int num_input_channels() const = 0; | 271 virtual int num_input_channels() const = 0; |
| 281 virtual int num_output_channels() const = 0; | 272 virtual int num_output_channels() const = 0; |
| 282 virtual int num_reverse_channels() const = 0; | 273 virtual int num_reverse_channels() const = 0; |
| 283 | 274 |
| 284 // Set to true when the output of AudioProcessing will be muted or in some | 275 // Set to true when the output of AudioProcessing will be muted or in some |
| 285 // other way not used. Ideally, the captured audio would still be processed, | 276 // other way not used. Ideally, the captured audio would still be processed, |
| 286 // but some components may change behavior based on this information. | 277 // but some components may change behavior based on this information. |
| 287 // Default false. | 278 // Default false. |
| 288 virtual void set_output_will_be_muted(bool muted) = 0; | 279 virtual void set_output_will_be_muted(bool muted) = 0; |
| 289 virtual bool output_will_be_muted() const = 0; | |
| 290 | 280 |
| 291 // Processes a 10 ms |frame| of the primary audio stream. On the client-side, | 281 // Processes a 10 ms |frame| of the primary audio stream. On the client-side, |
| 292 // this is the near-end (or captured) audio. | 282 // this is the near-end (or captured) audio. |
| 293 // | 283 // |
| 294 // If needed for enabled functionality, any function with the set_stream_ tag | 284 // If needed for enabled functionality, any function with the set_stream_ tag |
| 295 // must be called prior to processing the current frame. Any getter function | 285 // must be called prior to processing the current frame. Any getter function |
| 296 // with the stream_ tag which is needed should be called after processing. | 286 // with the stream_ tag which is needed should be called after processing. |
| 297 // | 287 // |
| 298 // The |sample_rate_hz_|, |num_channels_|, and |samples_per_channel_| | 288 // The |sample_rate_hz_|, |num_channels_|, and |samples_per_channel_| |
| 299 // members of |frame| must be valid. If changed from the previous call to this | 289 // members of |frame| must be valid. If changed from the previous call to this |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 // - t_capture is the time the first sample of a frame is captured by the | 370 // - t_capture is the time the first sample of a frame is captured by the |
| 381 // audio hardware and t_pull is the time the same frame is passed to | 371 // audio hardware and t_pull is the time the same frame is passed to |
| 382 // ProcessStream(). | 372 // ProcessStream(). |
| 383 virtual int set_stream_delay_ms(int delay) = 0; | 373 virtual int set_stream_delay_ms(int delay) = 0; |
| 384 virtual int stream_delay_ms() const = 0; | 374 virtual int stream_delay_ms() const = 0; |
| 385 virtual bool was_stream_delay_set() const = 0; | 375 virtual bool was_stream_delay_set() const = 0; |
| 386 | 376 |
| 387 // Call to signal that a key press occurred (true) or did not occur (false) | 377 // Call to signal that a key press occurred (true) or did not occur (false) |
| 388 // with this chunk of audio. | 378 // with this chunk of audio. |
| 389 virtual void set_stream_key_pressed(bool key_pressed) = 0; | 379 virtual void set_stream_key_pressed(bool key_pressed) = 0; |
| 390 virtual bool stream_key_pressed() const = 0; | |
| 391 | 380 |
| 392 // Sets a delay |offset| in ms to add to the values passed in through | 381 // Sets a delay |offset| in ms to add to the values passed in through |
| 393 // set_stream_delay_ms(). May be positive or negative. | 382 // set_stream_delay_ms(). May be positive or negative. |
| 394 // | 383 // |
| 395 // Note that this could cause an otherwise valid value passed to | 384 // Note that this could cause an otherwise valid value passed to |
| 396 // set_stream_delay_ms() to return an error. | 385 // set_stream_delay_ms() to return an error. |
| 397 virtual void set_delay_offset_ms(int offset) = 0; | 386 virtual void set_delay_offset_ms(int offset) = 0; |
| 398 virtual int delay_offset_ms() const = 0; | 387 virtual int delay_offset_ms() const = 0; |
| 399 | 388 |
| 400 // Starts recording debugging information to a file specified by |filename|, | 389 // Starts recording debugging information to a file specified by |filename|, |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 // This does not impact the size of frames passed to |ProcessStream()|. | 929 // This does not impact the size of frames passed to |ProcessStream()|. |
| 941 virtual int set_frame_size_ms(int size) = 0; | 930 virtual int set_frame_size_ms(int size) = 0; |
| 942 virtual int frame_size_ms() const = 0; | 931 virtual int frame_size_ms() const = 0; |
| 943 | 932 |
| 944 protected: | 933 protected: |
| 945 virtual ~VoiceDetection() {} | 934 virtual ~VoiceDetection() {} |
| 946 }; | 935 }; |
| 947 } // namespace webrtc | 936 } // namespace webrtc |
| 948 | 937 |
| 949 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 938 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
| OLD | NEW |