NUGU SDK Linux  1.7.6
SpeechRecognizerAggregatorInterface

SpeechRecognizerAggregator Interface. More...

+ Collaboration diagram for SpeechRecognizerAggregatorInterface:

Classes

struct  NuguClientKit::_RecognitionResult
 Model for holding recognition result. More...
 
class  NuguClientKit::ISpeechRecognizerAggregator
 SpeechRecognizerAggregator interface. More...
 
class  NuguClientKit::ISpeechRecognizerAggregatorListener
 SpeechRecognizerAggregator listener interface. More...
 

Typedefs

typedef struct NuguClientKit::_RecognitionResult NuguClientKit::RecognitionResult
 Model for holding recognition result. More...
 

Enumerations

enum class  NuguClientKit::_RecognitionResult::Status {
  NuguClientKit::_RecognitionResult::None , NuguClientKit::_RecognitionResult::Partial , NuguClientKit::_RecognitionResult::Complete , NuguClientKit::_RecognitionResult::Cancel ,
  NuguClientKit::_RecognitionResult::Error
}
 Result status. More...
 

Functions

virtual void NuguClientKit::ISpeechRecognizerAggregator::addListener (ISpeechRecognizerAggregatorListener *listener)=0
 Add the ISpeechRecognizerAggregatorListener object. More...
 
virtual void NuguClientKit::ISpeechRecognizerAggregator::finishListening ()=0
 finish listening speech
 
virtual void NuguClientKit::ISpeechRecognizerAggregatorListener::onASRState (ASRState state, const std::string &dialog_id, ASRInitiator initiator)=0
 Notify to user the asr state changed. More...
 
virtual void NuguClientKit::ISpeechRecognizerAggregatorListener::onResult (const RecognitionResult &result, const std::string &dialog_id)=0
 Notify to user the recognition result. More...
 
virtual void NuguClientKit::ISpeechRecognizerAggregatorListener::onWakeupState (WakeupDetectState state, float power_noise, float power_speech)=0
 Notify to user the wakeup detection state changed. More...
 
virtual void NuguClientKit::ISpeechRecognizerAggregator::removeListener (ISpeechRecognizerAggregatorListener *listener)=0
 Remove the ISpeechRecognizerAggregatorListener object. More...
 
virtual void NuguClientKit::ISpeechRecognizerAggregator::setWakeupHandler (const std::shared_ptr< IWakeupHandler > &wakeup_handler)=0
 Set the IWakeupHandler object. More...
 
virtual bool NuguClientKit::ISpeechRecognizerAggregator::setWakeupModel (const WakeupModelFile &model_file)=0
 Set wakeup model file. More...
 
virtual void NuguClientKit::ISpeechRecognizerAggregator::startListening (float power_noise=0, float power_speech=0, ASRInitiator initiator=ASRInitiator::TAP)=0
 Start recognizing speech. More...
 
virtual void NuguClientKit::ISpeechRecognizerAggregator::startListeningWithTrigger ()=0
 Start detecting wakeup and progress recognizing speech after wakeup detected.
 
virtual void NuguClientKit::ISpeechRecognizerAggregator::stopListening (bool cancel=false)=0
 Stop both recognizing speech and detecting wakeup. More...
 

Variables

ASRError NuguClientKit::_RecognitionResult::error
 
bool NuguClientKit::_RecognitionResult::listen_timeout_fail_beep
 
std::string NuguClientKit::_RecognitionResult::recognized_text
 
Status NuguClientKit::_RecognitionResult::status
 

Detailed Description

SpeechRecognizerAggregator Interface.

Interface of SpeechRecognizerAggregator for operating wakeup detection and speech recognition process conveniently.

Typedef Documentation

◆ RecognitionResult

Enumeration Type Documentation

◆ Status

Result status.

Enumerator
None 

no result

Partial 

partial text received

Complete 

complete text received

Cancel 

recognition canceled

Error 

error occurred

Function Documentation

◆ 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]statewakeup detection state
[in]power_noisemin power value
[in]power_speechmax 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]stateasr state
[in]dialog_iddialog request id
[in]initiatorasr 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]resultrecognition result
[in]dialog_iddialog request id

◆ addListener()

virtual void NuguClientKit::ISpeechRecognizerAggregator::addListener ( ISpeechRecognizerAggregatorListener listener)
pure virtual

Add the ISpeechRecognizerAggregatorListener object.

Parameters
[in]listenerISpeechRecognizerAggregatorListener object

◆ removeListener()

virtual void NuguClientKit::ISpeechRecognizerAggregator::removeListener ( ISpeechRecognizerAggregatorListener listener)
pure virtual

Remove the ISpeechRecognizerAggregatorListener object.

Parameters
[in]listenerISpeechRecognizerAggregatorListener object

◆ setWakeupHandler()

virtual void NuguClientKit::ISpeechRecognizerAggregator::setWakeupHandler ( const std::shared_ptr< IWakeupHandler > &  wakeup_handler)
pure virtual

Set the IWakeupHandler object.

Parameters
[in]wakeup_handlerIWakeupHandler object

◆ setWakeupModel()

virtual bool NuguClientKit::ISpeechRecognizerAggregator::setWakeupModel ( const WakeupModelFile model_file)
pure virtual

Set wakeup model file.

Parameters
[in]model_filewakeup 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_noisemin wakeup power value
[in]power_speechmax wakeup power value
[in]initiatorasr initiator

◆ stopListening()

virtual void NuguClientKit::ISpeechRecognizerAggregator::stopListening ( bool  cancel = false)
pure virtual

Stop both recognizing speech and detecting wakeup.

Parameters
[in]cancelif true, cancel the directives to be received for current dialog

Variable Documentation

◆ status

Status NuguClientKit::_RecognitionResult::status

result status

◆ recognized_text

std::string NuguClientKit::_RecognitionResult::recognized_text

partial or complete recognized text

◆ error

ASRError NuguClientKit::_RecognitionResult::error

ASR error

◆ listen_timeout_fail_beep

bool NuguClientKit::_RecognitionResult::listen_timeout_fail_beep

flag whether to play fail beep or not when listen-timeout occurred