![]() |
Alexa Auto SDK
2.0.0
|
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 () |
SpeechRecognizer should be extended to initiate voice interactions with Alexa and provide audio input to AVS.
SpeechRecognizer provides interfaces for
AlexaClient::dialogStateChanged()
. Describes type of event that initiated the speech request
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.
true
if the Engine successfully initiated a recognize event, else false
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.
true
if the Engine successfully started a recognize event, else false
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.
[in] | initiator | The Initiator type for the speech recognition event |
[in] | keywordBegin | The sample index where the keyword begins. This is required when the initator type is WAKEWORD , otherwise should be set to SpeechRecognizer::UNSPECIFIED_INDEX . |
[in] | keywordEnd | The sample index where the keyword ends. This is required when the initator type is WAKEWORD , otherwise should be set to SpeechRecognizer::UNSPECIFIED_INDEX . |
[in] | keyword | The keyword being recognized, e.g. "alexa". This is required when the initator type is WAKEWORD , otherwise should be set to an empty string. |
true
if the Engine successfully started a recognize event, else false
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.
true
if the Engine successfully terminated the current recognize event, else false
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.
true
if the Engine successfully enabled wake word detection, else false
bool aace::alexa::SpeechRecognizer::disableWakewordDetection | ( | ) |
Notifies the Engine to disable the wake word engine
true
if the Engine successfully disabled wakeword detection, else false
bool aace::alexa::SpeechRecognizer::isWakewordDetectionEnabled | ( | ) |
Checks if wake word detection is enabled in the Engine
true
if wake word detection is enabled, else false
|
virtual |
Notifies the platform implementation when a wake word is detected
[in] | wakeword | The wake word that was detected |
true
if the Engine should initiate a recognize event, false
if the Engine should ignore the invocation
|
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