SpeechRecognizerAggregator Interface.
More...
SpeechRecognizerAggregator Interface.
Interface of SpeechRecognizerAggregator for operating wakeup detection and speech recognition process conveniently.
◆ RecognitionResult
◆ Status
Result status.
Enumerator |
---|
None | no result
|
Partial | partial text received
|
Complete | complete text received
|
Cancel | recognition canceled
|
Error | error occurred
|
◆ onWakeupState()
virtual void NuguClientKit::ISpeechRecognizerAggregatorListener::onWakeupState |
( |
WakeupDetectState |
state, |
|
|
float |
power_noise, |
|
|
float |
power_speech |
|
) |
| |
|
pure virtual |
Notify to user the wakeup detection state changed.
- Parameters
-
[in] | state | wakeup detection state |
[in] | power_noise | min power value |
[in] | power_speech | max power value |
◆ onASRState()
virtual void NuguClientKit::ISpeechRecognizerAggregatorListener::onASRState |
( |
ASRState |
state, |
|
|
const std::string & |
dialog_id, |
|
|
ASRInitiator |
initiator |
|
) |
| |
|
pure virtual |
Notify to user the asr state changed.
- Parameters
-
[in] | state | asr state |
[in] | dialog_id | dialog request id |
[in] | initiator | asr initiator |
◆ onResult()
virtual void NuguClientKit::ISpeechRecognizerAggregatorListener::onResult |
( |
const RecognitionResult & |
result, |
|
|
const std::string & |
dialog_id |
|
) |
| |
|
pure virtual |
Notify to user the recognition result.
- Parameters
-
[in] | result | recognition result |
[in] | dialog_id | dialog request id |
◆ addListener()
◆ removeListener()
◆ setWakeupHandler()
virtual void NuguClientKit::ISpeechRecognizerAggregator::setWakeupHandler |
( |
const std::shared_ptr< IWakeupHandler > & |
wakeup_handler | ) |
|
|
pure virtual |
◆ setWakeupModel()
virtual bool NuguClientKit::ISpeechRecognizerAggregator::setWakeupModel |
( |
const WakeupModelFile & |
model_file | ) |
|
|
pure virtual |
Set wakeup model file.
- Parameters
-
[in] | model_file | wakeup model file |
- Returns
- true if set success, otherwise false
◆ startListening()
virtual void NuguClientKit::ISpeechRecognizerAggregator::startListening |
( |
float |
power_noise = 0 , |
|
|
float |
power_speech = 0 , |
|
|
ASRInitiator |
initiator = ASRInitiator::TAP |
|
) |
| |
|
pure virtual |
Start recognizing speech.
- Parameters
-
[in] | power_noise | min wakeup power value |
[in] | power_speech | max wakeup power value |
[in] | initiator | asr initiator |
◆ stopListening()
virtual void NuguClientKit::ISpeechRecognizerAggregator::stopListening |
( |
bool |
cancel = false | ) |
|
|
pure virtual |
Stop both recognizing speech and detecting wakeup.
- Parameters
-
[in] | cancel | if true, cancel the directives to be received for current dialog |
◆ status
Status NuguClientKit::_RecognitionResult::status |
◆ recognized_text
std::string NuguClientKit::_RecognitionResult::recognized_text |
partial or complete recognized text
◆ error
ASRError NuguClientKit::_RecognitionResult::error |
◆ listen_timeout_fail_beep
bool NuguClientKit::_RecognitionResult::listen_timeout_fail_beep |
flag whether to play fail beep or not when listen-timeout occurred