OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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_VAD_VOICE_ACTIVITY_DETECTOR_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_VAD_VOICE_ACTIVITY_DETECTOR_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_VAD_VOICE_ACTIVITY_DETECTOR_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_VAD_VOICE_ACTIVITY_DETECTOR_H_ |
13 | 13 |
| 14 #include <memory> |
14 #include <vector> | 15 #include <vector> |
15 | 16 |
16 #include "webrtc/base/scoped_ptr.h" | |
17 #include "webrtc/common_audio/resampler/include/resampler.h" | 17 #include "webrtc/common_audio/resampler/include/resampler.h" |
18 #include "webrtc/modules/audio_processing/vad/vad_audio_proc.h" | 18 #include "webrtc/modules/audio_processing/vad/vad_audio_proc.h" |
19 #include "webrtc/modules/audio_processing/vad/common.h" | 19 #include "webrtc/modules/audio_processing/vad/common.h" |
20 #include "webrtc/modules/audio_processing/vad/pitch_based_vad.h" | 20 #include "webrtc/modules/audio_processing/vad/pitch_based_vad.h" |
21 #include "webrtc/modules/audio_processing/vad/standalone_vad.h" | 21 #include "webrtc/modules/audio_processing/vad/standalone_vad.h" |
22 | 22 |
23 namespace webrtc { | 23 namespace webrtc { |
24 | 24 |
25 // A Voice Activity Detector (VAD) that combines the voice probability from the | 25 // A Voice Activity Detector (VAD) that combines the voice probability from the |
26 // StandaloneVad and PitchBasedVad to get a more robust estimation. | 26 // StandaloneVad and PitchBasedVad to get a more robust estimation. |
(...skipping 24 matching lines...) Expand all Loading... |
51 private: | 51 private: |
52 // TODO(aluebs): Change these to float. | 52 // TODO(aluebs): Change these to float. |
53 std::vector<double> chunkwise_voice_probabilities_; | 53 std::vector<double> chunkwise_voice_probabilities_; |
54 std::vector<double> chunkwise_rms_; | 54 std::vector<double> chunkwise_rms_; |
55 | 55 |
56 float last_voice_probability_; | 56 float last_voice_probability_; |
57 | 57 |
58 Resampler resampler_; | 58 Resampler resampler_; |
59 VadAudioProc audio_processing_; | 59 VadAudioProc audio_processing_; |
60 | 60 |
61 rtc::scoped_ptr<StandaloneVad> standalone_vad_; | 61 std::unique_ptr<StandaloneVad> standalone_vad_; |
62 PitchBasedVad pitch_based_vad_; | 62 PitchBasedVad pitch_based_vad_; |
63 | 63 |
64 int16_t resampled_[kLength10Ms]; | 64 int16_t resampled_[kLength10Ms]; |
65 AudioFeatures features_; | 65 AudioFeatures features_; |
66 }; | 66 }; |
67 | 67 |
68 } // namespace webrtc | 68 } // namespace webrtc |
69 | 69 |
70 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_VAD_VOICE_ACTIVITY_DETECTOR_H_ | 70 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_VAD_VOICE_ACTIVITY_DETECTOR_H_ |
OLD | NEW |