ConsumerModule that performs Automatic Speech Recognition. More...
#include <Recognizer.hpp>
Public Member Functions | |
| ~Recognizer () noexcept override | |
| auto | name () const -> std::string const & |
| Name of this particular Recognizer instance. | |
| auto | upTime () const -> int |
Amount of milliseconds of audio processed for the current model(s), expressed as int. | |
| auto | upTimeMs () const -> std::chrono::milliseconds |
Amount of milliseconds of audio processed for the current model(s), expressed as std::chrono::milliseconds. | |
| virtual void | setModel (std::string const &model, int startTime)=0 |
| Applies a new recognition model. | |
| void | setModel (std::string const &model) |
| Applies a new recognition model. | |
| virtual void | setModels (std::unordered_set< std::string > const &models, int startTime)=0 |
| Applies multiple recognition models at the same time. | |
| void | setModels (std::unordered_set< std::string > const &models) |
| Applies multiple recognition models at the same time. | |
| Addon::EntryPoint * | postProcessor () const |
| Get the active ASR post-processor entry point. | |
| Public Member Functions inherited from Vsdk::Audio::ConsumerModule | |
| virtual | ~ConsumerModule ()=default |
Protected Member Functions | |
| Recognizer (std::string name) noexcept | |
| virtual void | configure (std::string const &, nlohmann::json const &) |
| virtual bool | processBuffer (Audio::Buffer const &buffer, bool last)=0 |
| void | dispatchResult (ResultType resultType, std::string typeString, nlohmann::json result, bool isFinal) const override |
| void | dispatchEvent (EventCode code, std::string message, std::chrono::milliseconds time) |
| void | dispatchError (ErrorType type, ErrorCode code, std::string message=std::string()) |
| void | setUpTime (double upTime) |
| bool | userWordEnrollmentEnabled () const |
| Whether user-word enrolling is enabled. | |
| void | setUserWordEnrollmentEnabled (bool enabled) |
| auto | userWordStatusReporter () -> details::StatusReporter< RecognizerEventCode, RecognizerErrorCode > & |
Protected Attributes | |
| std::string | _name |
| double | _upTime |
| Addon::ASRPostProcessorPtr | _postProcessor |
ConsumerModule that performs Automatic Speech Recognition.
|
explicitprotectednoexcept |
|
overridedefaultnoexcept |
| auto Recognizer::name | ( | ) | const -> std::string const & |
Name of this particular Recognizer instance.
| auto Recognizer::upTime | ( | ) | const -> int |
Amount of milliseconds of audio processed for the current model(s), expressed as int.
| auto Recognizer::upTimeMs | ( | ) | const -> std::chrono::milliseconds |
Amount of milliseconds of audio processed for the current model(s), expressed as std::chrono::milliseconds.
|
pure virtual |
Applies a new recognition model.
| model | Found in the configuration under asr.models |
| startTime | Time from which the recognizer starts processing audio again. This is usually taken from a previous result, like so: setModel(model, hypothesis["end_time"].get<int>());
virtual void setModel(std::string const &model, int startTime)=0 Applies a new recognition model. |
startTime parameter and will recognize again starting from the moment the model is fully loaded | void Recognizer::setModel | ( | std::string const & | model | ) |
|
pure virtual |
Applies multiple recognition models at the same time.
| models | Found in the configuration under asr.models |
| startTime | Time from which the recognizer starts processing audio again. This is usually taken from a previous result, like so: setModel(model, hypothesis["end_time"].get<int>());
|
startTime parameter and will recognize again starting from the moment the models are fully loaded | void Recognizer::setModels | ( | std::unordered_set< std::string > const & | models | ) |
Applies multiple recognition models at the same time.
Equivalent to calling:
| Addon::EntryPoint * Vsdk::Asr::Recognizer::postProcessor | ( | ) | const |
Get the active ASR post-processor entry point.
Returns a pointer to the EntryPoint interface of the currently configured ASR post-processor. This allows you to invoke commands or operations on the plugin through the generic dispatch mechanism
|
protectedvirtual |
|
protectedpure virtual |
true if the buffer has been processed, else false
|
overrideprotected |
|
protected |
|
protected |
|
protected |
|
protected |
Whether user-word enrolling is enabled.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |