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 |
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
13 | 13 |
14 // MSVC++ requires this to be set before any other includes to get M_PI. | 14 // MSVC++ requires this to be set before any other includes to get M_PI. |
15 #define _USE_MATH_DEFINES | 15 #define _USE_MATH_DEFINES |
16 | 16 |
17 #include <math.h> | 17 #include <math.h> |
18 #include <stddef.h> // size_t | 18 #include <stddef.h> // size_t |
19 #include <stdio.h> // FILE | 19 #include <stdio.h> // FILE |
20 #include <vector> | 20 #include <vector> |
21 | 21 |
22 #include "webrtc/base/arraysize.h" | 22 #include "webrtc/base/arraysize.h" |
| 23 #include "webrtc/base/optional.h" |
23 #include "webrtc/base/platform_file.h" | 24 #include "webrtc/base/platform_file.h" |
24 #include "webrtc/modules/audio_processing/beamformer/array_util.h" | 25 #include "webrtc/modules/audio_processing/beamformer/array_util.h" |
25 #include "webrtc/modules/audio_processing/include/config.h" | 26 #include "webrtc/modules/audio_processing/include/config.h" |
26 #include "webrtc/typedefs.h" | 27 #include "webrtc/typedefs.h" |
27 | 28 |
28 namespace webrtc { | 29 namespace webrtc { |
29 | 30 |
30 struct AecCore; | 31 struct AecCore; |
31 | 32 |
32 class AudioFrame; | 33 class AudioFrame; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // processing. It is being introduced gradually and until it is fully | 245 // processing. It is being introduced gradually and until it is fully |
245 // introduced, it is prone to change. | 246 // introduced, it is prone to change. |
246 // TODO(peah): Remove this comment once the new config scheme is fully rolled | 247 // TODO(peah): Remove this comment once the new config scheme is fully rolled |
247 // out. | 248 // out. |
248 // | 249 // |
249 // The parameters and behavior of the audio processing module are controlled | 250 // The parameters and behavior of the audio processing module are controlled |
250 // by changing the default values in the AudioProcessing::Config struct. | 251 // by changing the default values in the AudioProcessing::Config struct. |
251 // The config is applied by passing the struct to the ApplyConfig method. | 252 // The config is applied by passing the struct to the ApplyConfig method. |
252 struct Config { | 253 struct Config { |
253 struct LevelController { | 254 struct LevelController { |
| 255 LevelController(); |
| 256 ~LevelController(); |
254 bool enabled = false; | 257 bool enabled = false; |
| 258 |
| 259 // Sets the initial peak level to use inside the level controller in order |
| 260 // to compute the signal gain. The unit for the peak level is dBFS and |
| 261 // the allowed range is [-100, 0]. |
| 262 rtc::Optional<float> initial_level; |
255 } level_controller; | 263 } level_controller; |
256 }; | 264 }; |
257 | 265 |
258 // TODO(mgraczyk): Remove once all methods that use ChannelLayout are gone. | 266 // TODO(mgraczyk): Remove once all methods that use ChannelLayout are gone. |
259 enum ChannelLayout { | 267 enum ChannelLayout { |
260 kMono, | 268 kMono, |
261 // Left, right. | 269 // Left, right. |
262 kStereo, | 270 kStereo, |
263 // Mono, keyboard, and mic. | 271 // Mono, keyboard, and mic. |
264 kMonoAndKeyboard, | 272 kMonoAndKeyboard, |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 // This does not impact the size of frames passed to |ProcessStream()|. | 1003 // This does not impact the size of frames passed to |ProcessStream()|. |
996 virtual int set_frame_size_ms(int size) = 0; | 1004 virtual int set_frame_size_ms(int size) = 0; |
997 virtual int frame_size_ms() const = 0; | 1005 virtual int frame_size_ms() const = 0; |
998 | 1006 |
999 protected: | 1007 protected: |
1000 virtual ~VoiceDetection() {} | 1008 virtual ~VoiceDetection() {} |
1001 }; | 1009 }; |
1002 } // namespace webrtc | 1010 } // namespace webrtc |
1003 | 1011 |
1004 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 1012 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
OLD | NEW |