Files
platform-external-webrtc/webrtc/common_audio/vad/include/vad.h
henrik.lundin@webrtc.org 8aa4d2d2cd Creating a C++ wrapper class for VAD
Also adding a mock. This work is part of an ongoing effort to
encapsulate encoders in AudioEncoder classes. The CNG encoder will also
be implemented as an AudioEncoder class, and will also contain a VAD
C++ wrapper.

BUG=3926
R=bjornv@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/27839004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7570 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-30 13:23:25 +00:00

46 lines
1.2 KiB
C++

/*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_COMMON_AUDIO_VAD_INCLUDE_VAD_H_
#define WEBRTC_COMMON_AUDIO_VAD_INCLUDE_VAD_H_
#include "webrtc/base/checks.h"
#include "webrtc/common_audio/vad/include/webrtc_vad.h"
#include "webrtc/typedefs.h"
namespace webrtc {
// This is a C++ wrapper class for WebRtcVad.
class Vad {
public:
enum Aggressiveness {
kVadNormal = 0,
kVadLowBitrate = 1,
kVadAggressive = 2,
kVadVeryAggressive = 3
};
enum Activity { kPassive = 0, kActive = 1, kError = -1 };
explicit Vad(enum Aggressiveness mode);
virtual ~Vad();
enum Activity VoiceActivity(const int16_t* audio,
size_t num_samples,
int sample_rate_hz);
private:
VadInst* handle_;
};
} // namespace webrtc
#endif // WEBRTC_COMMON_AUDIO_VAD_INCLUDE_VAD_H_