sherpa-onnx C API 1.0
Public C API and C++ wrapper for sherpa-onnx
Loading...
Searching...
No Matches
sherpa_onnx::cxx::KeywordSpotter Class Reference

RAII wrapper for keyword spotting. More...

#include <cxx-api.h>

+ Inheritance diagram for sherpa_onnx::cxx::KeywordSpotter:
+ Collaboration diagram for sherpa_onnx::cxx::KeywordSpotter:

Public Member Functions

void Destroy (const SherpaOnnxKeywordSpotter *p) const
 Destroy the wrapped C handle.
 
OnlineStream CreateStream () const
 Create a keyword stream using configured keywords.
 
OnlineStream CreateStream (const std::string &keywords) const
 Create a keyword stream with inline extra or replacement keywords.
 
bool IsReady (const OnlineStream *s) const
 Check whether the stream has enough data to decode.
 
void Decode (const OnlineStream *s) const
 Decode one ready stream.
 
void Decode (const OnlineStream *ss, int32_t n) const
 Decode multiple ready streams in parallel.
 
void Reset (const OnlineStream *s) const
 Reset a stream after a keyword trigger.
 
KeywordResult GetResult (const OnlineStream *s) const
 Return the copied keyword spotting result for a stream.
 
- Public Member Functions inherited from sherpa_onnx::cxx::MoveOnly< KeywordSpotter, SherpaOnnxKeywordSpotter >
 MoveOnly ()=default
 Construct an empty wrapper.
 
 MoveOnly (const SherpaOnnxKeywordSpotter *p)
 Construct a wrapper from a raw C handle.
 
 MoveOnly (const MoveOnly &)=delete
 
 MoveOnly (MoveOnly &&other)
 
 ~MoveOnly ()
 Destroy the wrapped handle if present.
 
MoveOnlyoperator= (const MoveOnly &)=delete
 
MoveOnlyoperator= (MoveOnly &&other)
 
const SherpaOnnxKeywordSpotterGet () const
 Return the wrapped raw pointer without transferring ownership.
 
const SherpaOnnxKeywordSpotterRelease ()
 Release ownership of the wrapped raw pointer.
 

Static Public Member Functions

static KeywordSpotter Create (const KeywordSpotterConfig &config)
 Create a keyword spotter from a config struct.
 

Additional Inherited Members

- Protected Attributes inherited from sherpa_onnx::cxx::MoveOnly< KeywordSpotter, SherpaOnnxKeywordSpotter >
const SherpaOnnxKeywordSpotterp_
 

Detailed Description

Definition at line 1176 of file cxx-api.h.

Member Function Documentation

◆ Create()

static KeywordSpotter sherpa_onnx::cxx::KeywordSpotter::Create ( const KeywordSpotterConfig config)
static

◆ CreateStream() [1/2]

OnlineStream sherpa_onnx::cxx::KeywordSpotter::CreateStream ( ) const

◆ CreateStream() [2/2]

OnlineStream sherpa_onnx::cxx::KeywordSpotter::CreateStream ( const std::string &  keywords) const

◆ Decode() [1/2]

void sherpa_onnx::cxx::KeywordSpotter::Decode ( const OnlineStream s) const

◆ Decode() [2/2]

void sherpa_onnx::cxx::KeywordSpotter::Decode ( const OnlineStream ss,
int32_t  n 
) const

◆ Destroy()

void sherpa_onnx::cxx::KeywordSpotter::Destroy ( const SherpaOnnxKeywordSpotter p) const

◆ GetResult()

KeywordResult sherpa_onnx::cxx::KeywordSpotter::GetResult ( const OnlineStream s) const

◆ IsReady()

bool sherpa_onnx::cxx::KeywordSpotter::IsReady ( const OnlineStream s) const

◆ Reset()

void sherpa_onnx::cxx::KeywordSpotter::Reset ( const OnlineStream s) const

The documentation for this class was generated from the following file: