|
sherpa-onnx C API 1.0
Public C API and C++ wrapper for sherpa-onnx
|
RAII wrapper for voice activity detection. More...
#include <cxx-api.h>
Inheritance diagram for sherpa_onnx::cxx::VoiceActivityDetector:
Collaboration diagram for sherpa_onnx::cxx::VoiceActivityDetector:Public Member Functions | |
| void | Destroy (const SherpaOnnxVoiceActivityDetector *p) const |
| Destroy the wrapped C handle. | |
| void | AcceptWaveform (const float *samples, int32_t n) const |
| Feed more audio samples to the detector. | |
| bool | IsEmpty () const |
| Check whether no speech segments are currently queued. | |
| bool | IsDetected () const |
| Check whether speech is currently detected. | |
| void | Pop () const |
| Remove the front queued speech segment. | |
| void | Clear () const |
| Remove all queued speech segments. | |
| SpeechSegment | Front () const |
| Return the front queued speech segment. | |
| std::shared_ptr< SpeechSegment > | FrontPtr () const |
| Like Front(), but returns the segment in a shared pointer. | |
| void | Reset () const |
| Reset the detector state. | |
| void | Flush () const |
| Flush buffered context at end of input. | |
Public Member Functions inherited from sherpa_onnx::cxx::MoveOnly< VoiceActivityDetector, SherpaOnnxVoiceActivityDetector > | |
| MoveOnly ()=default | |
| Construct an empty wrapper. | |
| MoveOnly (const SherpaOnnxVoiceActivityDetector *p) | |
| Construct a wrapper from a raw C handle. | |
| MoveOnly (const MoveOnly &)=delete | |
| MoveOnly (MoveOnly &&other) | |
| ~MoveOnly () | |
| Destroy the wrapped handle if present. | |
| MoveOnly & | operator= (const MoveOnly &)=delete |
| MoveOnly & | operator= (MoveOnly &&other) |
| const SherpaOnnxVoiceActivityDetector * | Get () const |
| Return the wrapped raw pointer without transferring ownership. | |
| const SherpaOnnxVoiceActivityDetector * | Release () |
| Release ownership of the wrapped raw pointer. | |
Static Public Member Functions | |
| static VoiceActivityDetector | Create (const VadModelConfig &config, float buffer_size_in_seconds) |
| Create a VAD instance. | |
Additional Inherited Members | |
Protected Attributes inherited from sherpa_onnx::cxx::MoveOnly< VoiceActivityDetector, SherpaOnnxVoiceActivityDetector > | |
| const SherpaOnnxVoiceActivityDetector * | p_ |
The wrapper collects detected speech segments internally. Use IsEmpty(), Front(), and Pop() to consume them.
| void sherpa_onnx::cxx::VoiceActivityDetector::AcceptWaveform | ( | const float * | samples, |
| int32_t | n | ||
| ) | const |
| void sherpa_onnx::cxx::VoiceActivityDetector::Clear | ( | ) | const |
|
static |
| void sherpa_onnx::cxx::VoiceActivityDetector::Destroy | ( | const SherpaOnnxVoiceActivityDetector * | p | ) | const |
| void sherpa_onnx::cxx::VoiceActivityDetector::Flush | ( | ) | const |
| SpeechSegment sherpa_onnx::cxx::VoiceActivityDetector::Front | ( | ) | const |
| std::shared_ptr< SpeechSegment > sherpa_onnx::cxx::VoiceActivityDetector::FrontPtr | ( | ) | const |
| bool sherpa_onnx::cxx::VoiceActivityDetector::IsDetected | ( | ) | const |
| bool sherpa_onnx::cxx::VoiceActivityDetector::IsEmpty | ( | ) | const |
| void sherpa_onnx::cxx::VoiceActivityDetector::Pop | ( | ) | const |
| void sherpa_onnx::cxx::VoiceActivityDetector::Reset | ( | ) | const |