Alexa Auto SDK  4.3
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 ()
 
virtual bool wakewordDetected (const std::string &wakeword)
 
virtual void endOfSpeechDetected ()
 

Detailed Description

SpeechRecognizer should be extended to initiate voice interactions with Alexa.

SpeechRecognizer provides interfaces for

Note
For observing Alexa dialog state transitions, see AlexaClient::dialogStateChanged().
Deprecated:
This platform interface is deprecated. Use the Alexa Auto Services Bridge (AASB) message broker to publish and subscribe to AASB messages instead.
See also
aace::core::MessageBroker

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 aace::audio::AudioInput::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 aace::audio::AudioInput::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.

If the initiator 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 initiator type is WAKEWORD, otherwise should be set to SpeechRecognizer::UNSPECIFIED_INDEX.
[in]keywordEndThe sample index where the keyword ends. This is required when the initiator type is WAKEWORD, otherwise should be set to SpeechRecognizer::UNSPECIFIED_INDEX.
[in]keywordThe keyword being recognized, e.g. "alexa". This is required when the initiator 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 aace::audio::AudioInput::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

◆ 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 4.3 - Copyright 2017-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0