RAII wrapper for a streaming recognizer.
More...
#include <cxx-api.h>
Example:
wave.samples.size());
while (recognizer.
IsReady(&stream)) {
}
RAII wrapper for a streaming recognizer.
void Decode(const OnlineStream *s) const
Decode one ready stream.
OnlineRecognizerResult GetResult(const OnlineStream *s) const
Return the current recognition result for a stream.
static OnlineRecognizer Create(const OnlineRecognizerConfig &config)
Create a streaming recognizer from a config struct.
bool IsReady(const OnlineStream *s) const
Check whether the given stream has enough data to decode.
OnlineStream CreateStream() const
Create a stream that uses the recognizer's configured hotwords.
void InputFinished() const
Indicate that no more input audio will be provided.
void AcceptWaveform(int32_t sample_rate, const float *samples, int32_t n) const
Append audio samples to the stream.
Definition at line 384 of file cxx-api.h.
◆ Create()
◆ CreateStream() [1/2]
| OnlineStream sherpa_onnx::cxx::OnlineRecognizer::CreateStream |
( |
| ) |
const |
◆ CreateStream() [2/2]
| OnlineStream sherpa_onnx::cxx::OnlineRecognizer::CreateStream |
( |
const std::string & |
hotwords | ) |
const |
◆ Decode() [1/2]
| void sherpa_onnx::cxx::OnlineRecognizer::Decode |
( |
const OnlineStream * |
s | ) |
const |
◆ Decode() [2/2]
| void sherpa_onnx::cxx::OnlineRecognizer::Decode |
( |
const OnlineStream * |
ss, |
|
|
int32_t |
n |
|
) |
| const |
◆ Destroy()
◆ GetResult()
◆ IsEndpoint()
| bool sherpa_onnx::cxx::OnlineRecognizer::IsEndpoint |
( |
const OnlineStream * |
s | ) |
const |
◆ IsReady()
| bool sherpa_onnx::cxx::OnlineRecognizer::IsReady |
( |
const OnlineStream * |
s | ) |
const |
◆ Reset()
| void sherpa_onnx::cxx::OnlineRecognizer::Reset |
( |
const OnlineStream * |
s | ) |
const |
The documentation for this class was generated from the following file: