Alexa Auto SDK  2.0.0
Public Types | Public Member Functions | List of all members
aace::alexa::SpeechRecognizer Class Reference

Public Types

using Initiator = SpeechRecognizerEngineInterface::Initiator
 

Public Member Functions

bool holdToTalk ()
 
bool tapToTalk ()
 
bool startCapture (Initiator initiator, uint64_t keywordBegin=UNSPECIFIED_INDEX, uint64_t keywordEnd=UNSPECIFIED_INDEX, const std::string &keyword="")
 
bool stopCapture ()
 
bool enableWakewordDetection ()
 
bool disableWakewordDetection ()
 
bool isWakewordDetectionEnabled ()
 
virtual bool wakewordDetected (const std::string &wakeword)
 
virtual void endOfSpeechDetected ()
 

Detailed Description

SpeechRecognizer should be extended to initiate voice interactions with Alexa and provide audio input to AVS.

SpeechRecognizer provides interfaces for

Note
For observing Alexa dialog state transitions, see AlexaClient::dialogStateChanged().

Member Typedef Documentation

◆ Initiator

Describes type of event that initiated the speech request

See also
aace::alexa::SpeechRecognizerEngineInterface::Initiator

Member Function Documentation

◆ holdToTalk()

bool aace::alexa::SpeechRecognizer::holdToTalk ( )

Notifies the Engine of a speech recognition event initiated by a press-and-hold action on the platform. The Engine will call startAudioInput() to notify the platform implementation when to start writing audio samples.

The platform implementation should call stopCapture() to terminate speech recognition on release of the press-and-hold action.

Returns
true if the Engine successfully initiated a recognize event, else false

◆ tapToTalk()

bool aace::alexa::SpeechRecognizer::tapToTalk ( )

Notifies the Engine of a speech recognition event initiated by a press-and-release action on the platform. The Engine will call startAudioInput() to notify the platform implementation when to start writing audio samples.

The Engine will terminate the recognize event initiated by the press-and-release action when end of speech is detected.

Returns
true if the Engine successfully started a recognize event, else false

◆ startCapture()

bool aace::alexa::SpeechRecognizer::startCapture ( Initiator  initiator,
uint64_t  keywordBegin = UNSPECIFIED_INDEX,
uint64_t  keywordEnd = UNSPECIFIED_INDEX,
const std::string &  keyword = "" 
)

Notifies the Engine of a speech recognition event. The Engine will call startAudioInput() to notify the platform implementation when to start writing audio samples.

If the initator type is HOLD_TO_TALK, then the platform implementation should call stopCapture() to terminate speech recognition on release of the press-and-hold action. Otherwise, the Engine will terminate the recognize event when end of speech is detected.

Parameters
[in]initiatorThe Initiator type for the speech recognition event
[in]keywordBeginThe sample index where the keyword begins. This is required when the initator type is WAKEWORD, otherwise should be set to SpeechRecognizer::UNSPECIFIED_INDEX.
[in]keywordEndThe sample index where the keyword ends. This is required when the initator type is WAKEWORD, otherwise should be set to SpeechRecognizer::UNSPECIFIED_INDEX.
[in]keywordThe keyword being recognized, e.g. "alexa". This is required when the initator type is WAKEWORD, otherwise should be set to an empty string.
Returns
true if the Engine successfully started a recognize event, else false

◆ stopCapture()

bool aace::alexa::SpeechRecognizer::stopCapture ( )

Notifies the Engine to terminate the current recognize event. The Engine will call stopAudioInput() to notify the platform implementation when to stop writing audio samples.

Returns
true if the Engine successfully terminated the current recognize event, else false

◆ enableWakewordDetection()

bool aace::alexa::SpeechRecognizer::enableWakewordDetection ( )

Notifies the Engine to enable the wake word engine. Wake word must be supported in the Engine to be enabled by this call.

Returns
true if the Engine successfully enabled wake word detection, else false

◆ disableWakewordDetection()

bool aace::alexa::SpeechRecognizer::disableWakewordDetection ( )

Notifies the Engine to disable the wake word engine

Returns
true if the Engine successfully disabled wakeword detection, else false

◆ isWakewordDetectionEnabled()

bool aace::alexa::SpeechRecognizer::isWakewordDetectionEnabled ( )

Checks if wake word detection is enabled in the Engine

Returns
true if wake word detection is enabled, else false

◆ wakewordDetected()

bool aace::alexa::SpeechRecognizer::wakewordDetected ( const std::string &  wakeword)
virtual

Notifies the platform implementation when a wake word is detected

Parameters
[in]wakewordThe wake word that was detected
Returns
true if the Engine should initiate a recognize event, false if the Engine should ignore the invocation

◆ endOfSpeechDetected()

void aace::alexa::SpeechRecognizer::endOfSpeechDetected ( )
virtual

Notifies the platform implementation when end of speech is detected for the current recognize event


Alexa Auto SDK 2.0.0 - Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0