|
sherpa-onnx C API 1.0
Public C API and C++ wrapper for sherpa-onnx
|
RAII wrapper for the circular buffer helper used by VAD. More...
#include <cxx-api.h>
Inheritance diagram for sherpa_onnx::cxx::CircularBuffer:
Collaboration diagram for sherpa_onnx::cxx::CircularBuffer:Public Member Functions | |
| void | Destroy (const SherpaOnnxCircularBuffer *p) const |
| Destroy the wrapped C handle. | |
| void | Push (const float *p, int32_t n) const |
| Append samples to the buffer. | |
| std::vector< float > | Get (int32_t start_index, int32_t n) const |
| Copy a contiguous span from the buffer. | |
| void | Pop (int32_t n) const |
| Remove samples from the head of the buffer. | |
| int32_t | Size () const |
| Return the number of stored samples. | |
| int32_t | Head () const |
| Return the current head index. | |
| void | Reset () const |
| Reset the buffer to empty. | |
Public Member Functions inherited from sherpa_onnx::cxx::MoveOnly< CircularBuffer, SherpaOnnxCircularBuffer > | |
| MoveOnly ()=default | |
| Construct an empty wrapper. | |
| MoveOnly (const SherpaOnnxCircularBuffer *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 SherpaOnnxCircularBuffer * | Get () const |
| Return the wrapped raw pointer without transferring ownership. | |
| const SherpaOnnxCircularBuffer * | Release () |
| Release ownership of the wrapped raw pointer. | |
Static Public Member Functions | |
| static CircularBuffer | Create (int32_t capacity) |
| Create a circular buffer with the given capacity in samples. | |
Additional Inherited Members | |
Protected Attributes inherited from sherpa_onnx::cxx::MoveOnly< CircularBuffer, SherpaOnnxCircularBuffer > | |
| const SherpaOnnxCircularBuffer * | p_ |
|
static |
| void sherpa_onnx::cxx::CircularBuffer::Destroy | ( | const SherpaOnnxCircularBuffer * | p | ) | const |
| std::vector< float > sherpa_onnx::cxx::CircularBuffer::Get | ( | int32_t | start_index, |
| int32_t | n | ||
| ) | const |
| int32_t sherpa_onnx::cxx::CircularBuffer::Head | ( | ) | const |
| void sherpa_onnx::cxx::CircularBuffer::Pop | ( | int32_t | n | ) | const |
| void sherpa_onnx::cxx::CircularBuffer::Push | ( | const float * | p, |
| int32_t | n | ||
| ) | const |
| void sherpa_onnx::cxx::CircularBuffer::Reset | ( | ) | const |
| int32_t sherpa_onnx::cxx::CircularBuffer::Size | ( | ) | const |