|
sherpa-onnx C API 1.0
Public C API and C++ wrapper for sherpa-onnx
|
RAII wrapper for an offline recognizer. More...
#include <cxx-api.h>
Inheritance diagram for sherpa_onnx::cxx::OfflineRecognizer:
Collaboration diagram for sherpa_onnx::cxx::OfflineRecognizer:Public Member Functions | |
| void | Destroy (const SherpaOnnxOfflineRecognizer *p) const |
| Destroy the wrapped C handle. | |
| OfflineStream | CreateStream () const |
| Create a stream using the recognizer's configured hotwords. | |
| OfflineStream | CreateStream (const std::string &hotwords) const |
| Create a stream with inline hotwords. | |
| void | Decode (const OfflineStream *s) const |
| Decode one offline stream. | |
| void | Decode (const OfflineStream *ss, int32_t n) const |
| Decode multiple offline streams in parallel. | |
| OfflineRecognizerResult | GetResult (const OfflineStream *s) const |
| Return the copied recognition result for one stream. | |
| std::shared_ptr< OfflineRecognizerResult > | GetResultPtr (const OfflineStream *s) const |
| Convenience wrapper that returns the result inside a shared pointer. | |
| void | SetConfig (const OfflineRecognizerConfig &config) const |
| Update recognizer runtime configuration after creation. | |
Public Member Functions inherited from sherpa_onnx::cxx::MoveOnly< OfflineRecognizer, SherpaOnnxOfflineRecognizer > | |
| MoveOnly ()=default | |
| Construct an empty wrapper. | |
| MoveOnly (const SherpaOnnxOfflineRecognizer *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 SherpaOnnxOfflineRecognizer * | Get () const |
| Return the wrapped raw pointer without transferring ownership. | |
| const SherpaOnnxOfflineRecognizer * | Release () |
| Release ownership of the wrapped raw pointer. | |
Static Public Member Functions | |
| static OfflineRecognizer | Create (const OfflineRecognizerConfig &config) |
| Create an offline recognizer from a config struct. | |
Additional Inherited Members | |
Protected Attributes inherited from sherpa_onnx::cxx::MoveOnly< OfflineRecognizer, SherpaOnnxOfflineRecognizer > | |
| const SherpaOnnxOfflineRecognizer * | p_ |
For most offline models, call AcceptWaveform() once per stream, then call Decode() and GetResult().
|
static |
| OfflineStream sherpa_onnx::cxx::OfflineRecognizer::CreateStream | ( | ) | const |
| OfflineStream sherpa_onnx::cxx::OfflineRecognizer::CreateStream | ( | const std::string & | hotwords | ) | const |
| void sherpa_onnx::cxx::OfflineRecognizer::Decode | ( | const OfflineStream * | s | ) | const |
| void sherpa_onnx::cxx::OfflineRecognizer::Decode | ( | const OfflineStream * | ss, |
| int32_t | n | ||
| ) | const |
| void sherpa_onnx::cxx::OfflineRecognizer::Destroy | ( | const SherpaOnnxOfflineRecognizer * | p | ) | const |
| OfflineRecognizerResult sherpa_onnx::cxx::OfflineRecognizer::GetResult | ( | const OfflineStream * | s | ) | const |
| std::shared_ptr< OfflineRecognizerResult > sherpa_onnx::cxx::OfflineRecognizer::GetResultPtr | ( | const OfflineStream * | s | ) | const |
This helper exists mainly for integration environments that prefer owning pointers, such as Unreal Engine.
| void sherpa_onnx::cxx::OfflineRecognizer::SetConfig | ( | const OfflineRecognizerConfig & | config | ) | const |