| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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_COMMON_AUDIO_VAD_INCLUDE_VAD_H_ | 11 #ifndef WEBRTC_COMMON_AUDIO_VAD_INCLUDE_VAD_H_ |
| 12 #define WEBRTC_COMMON_AUDIO_VAD_INCLUDE_VAD_H_ | 12 #define WEBRTC_COMMON_AUDIO_VAD_INCLUDE_VAD_H_ |
| 13 | 13 |
| 14 #include <memory> |
| 15 |
| 14 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
| 15 #include "webrtc/base/scoped_ptr.h" | |
| 16 #include "webrtc/common_audio/vad/include/webrtc_vad.h" | 17 #include "webrtc/common_audio/vad/include/webrtc_vad.h" |
| 17 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
| 18 | 19 |
| 19 namespace webrtc { | 20 namespace webrtc { |
| 20 | 21 |
| 21 class Vad { | 22 class Vad { |
| 22 public: | 23 public: |
| 23 enum Aggressiveness { | 24 enum Aggressiveness { |
| 24 kVadNormal = 0, | 25 kVadNormal = 0, |
| 25 kVadLowBitrate = 1, | 26 kVadLowBitrate = 1, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 36 // frame is 10, 20, or 30 ms long. | 37 // frame is 10, 20, or 30 ms long. |
| 37 virtual Activity VoiceActivity(const int16_t* audio, | 38 virtual Activity VoiceActivity(const int16_t* audio, |
| 38 size_t num_samples, | 39 size_t num_samples, |
| 39 int sample_rate_hz) = 0; | 40 int sample_rate_hz) = 0; |
| 40 | 41 |
| 41 // Resets VAD state. | 42 // Resets VAD state. |
| 42 virtual void Reset() = 0; | 43 virtual void Reset() = 0; |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 // Returns a Vad instance that's implemented on top of WebRtcVad. | 46 // Returns a Vad instance that's implemented on top of WebRtcVad. |
| 46 rtc::scoped_ptr<Vad> CreateVad(Vad::Aggressiveness aggressiveness); | 47 std::unique_ptr<Vad> CreateVad(Vad::Aggressiveness aggressiveness); |
| 47 | 48 |
| 48 } // namespace webrtc | 49 } // namespace webrtc |
| 49 | 50 |
| 50 #endif // WEBRTC_COMMON_AUDIO_VAD_INCLUDE_VAD_H_ | 51 #endif // WEBRTC_COMMON_AUDIO_VAD_INCLUDE_VAD_H_ |
| OLD | NEW |