AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface Class Referenceabstract

#include <SpeechInteractionHandlerInterface.h>

Inheritance diagram for alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface:
Inheritance graph
[legend]

Public Member Functions

virtual ~SpeechInteractionHandlerInterface ()=default
 
virtual std::future< bool > notifyOfWakeWord (capabilityAgents::aip::AudioProvider wakeWordAudioProvider, avsCommon::avs::AudioInputStream::Index beginIndex, avsCommon::avs::AudioInputStream::Index endIndex, std::string keyword, std::chrono::steady_clock::time_point startOfSpeechTimestamp, std::shared_ptr< const std::vector< char >> KWDMetadata=nullptr)=0
 
virtual std::future< bool > notifyOfTapToTalk (capabilityAgents::aip::AudioProvider tapToTalkAudioProvider, avsCommon::avs::AudioInputStream::Index beginIndex, std::chrono::steady_clock::time_point startOfSpeechTimestamp=std::chrono::steady_clock::now())=0
 
virtual std::future< bool > notifyOfHoldToTalkStart (capabilityAgents::aip::AudioProvider holdToTalkAudioProvider, std::chrono::steady_clock::time_point startOfSpeechTimestamp=std::chrono::steady_clock::now(), avsCommon::avs::AudioInputStream::Index beginIndex=capabilityAgents::aip::AudioInputProcessor::INVALID_INDEX)=0
 
virtual std::future< bool > notifyOfHoldToTalkEnd ()=0
 
virtual std::future< bool > notifyOfTapToTalkEnd ()=0
 

Detailed Description

A SpeechInteractionHandler may be any client component who responds to WakeWork and TapToTalk Events This specifies the interface to a SpeechInteractionHandler.

Constructor & Destructor Documentation

◆ ~SpeechInteractionHandlerInterface()

virtual alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface::~SpeechInteractionHandlerInterface ( )
virtualdefault

Member Function Documentation

◆ notifyOfHoldToTalkEnd()

virtual std::future<bool> alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface::notifyOfHoldToTalkEnd ( )
pure virtual

Ends a hold to talk interaction by forcing the client to stop streaming audio data to the cloud and ending any currently ongoing recognize interactions.

Returns
A future indicating whether audio streaming was successfully stopped. This can be false if this was called in the wrong state.

Implemented in alexaClientSDK::defaultClient::DefaultClient, and alexaClientSDK::sampleApplications::ipcServerSampleApp::liveViewController::LiveViewControllerPresentationAdapter.

◆ notifyOfHoldToTalkStart()

virtual std::future<bool> alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface::notifyOfHoldToTalkStart ( capabilityAgents::aip::AudioProvider  holdToTalkAudioProvider,
std::chrono::steady_clock::time_point  startOfSpeechTimestamp = std::chrono::steady_clock::now(),
avsCommon::avs::AudioInputStream::Index  beginIndex = capabilityAgents::aip::AudioInputProcessor::INVALID_INDEX 
)
pure virtual

Begins a hold to talk initiated Alexa interaction.

Parameters
holdToTalkAudioProviderThe audio provider containing the audio data stream along with its metadata.
startOfSpeechTimestampMoment in time when user started talking to Alexa. This parameter is optional and it is used to measure user perceived latency.
beginIndexAn optional parameter indicating where in the stream to start reading from.
Returns
A future indicating whether the interaction was successfully started.

Implemented in alexaClientSDK::defaultClient::DefaultClient, and alexaClientSDK::sampleApplications::ipcServerSampleApp::liveViewController::LiveViewControllerPresentationAdapter.

◆ notifyOfTapToTalk()

virtual std::future<bool> alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface::notifyOfTapToTalk ( capabilityAgents::aip::AudioProvider  tapToTalkAudioProvider,
avsCommon::avs::AudioInputStream::Index  beginIndex,
std::chrono::steady_clock::time_point  startOfSpeechTimestamp = std::chrono::steady_clock::now() 
)
pure virtual

Begins a tap to talk initiated Alexa interaction. Note that this can also be used for wake word engines that don't support providing both a begin and end index.

Parameters
tapToTalkAudioProviderThe audio provider containing the audio data stream along with its metadata.
beginIndexAn optional parameter indicating where in the stream to start reading from.
startOfSpeechTimestampMoment in time when user started talking to Alexa. This parameter is optional and it is used to measure user perceived latency. INVALID_INDEX may be used to explicitly communicate that there is no wake work.
Returns
A future indicating whether the interaction was successfully started.

Implemented in alexaClientSDK::defaultClient::DefaultClient, and alexaClientSDK::sampleApplications::ipcServerSampleApp::liveViewController::LiveViewControllerPresentationAdapter.

◆ notifyOfTapToTalkEnd()

virtual std::future<bool> alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface::notifyOfTapToTalkEnd ( )
pure virtual

Ends a tap to talk interaction by forcing the client to stop streaming audio data to the cloud and ending any currently ongoing recognize interactions.

Returns
A future indicating whether audio streaming was successfully stopped. This can be false if this was called in the wrong state.

Implemented in alexaClientSDK::defaultClient::DefaultClient, and alexaClientSDK::sampleApplications::ipcServerSampleApp::liveViewController::LiveViewControllerPresentationAdapter.

◆ notifyOfWakeWord()

virtual std::future<bool> alexaClientSDK::avsCommon::sdkInterfaces::SpeechInteractionHandlerInterface::notifyOfWakeWord ( capabilityAgents::aip::AudioProvider  wakeWordAudioProvider,
avsCommon::avs::AudioInputStream::Index  beginIndex,
avsCommon::avs::AudioInputStream::Index  endIndex,
std::string  keyword,
std::chrono::steady_clock::time_point  startOfSpeechTimestamp,
std::shared_ptr< const std::vector< char >>  KWDMetadata = nullptr 
)
pure virtual

Begins a wake word initiated Alexa interaction.

Parameters
wakeWordAudioProviderThe audio provider containing the audio data stream along with its metadata.
beginIndexThe begin index of the keyword found within the stream.
endIndexThe end index of the keyword found within the stream.
keywordThe keyword that was detected.
KWDMetadataWake word engine metadata.
startOfSpeechTimestampMoment in time when user started talking to Alexa.
Returns
A future indicating whether the interaction was successfully started.

Implemented in alexaClientSDK::defaultClient::DefaultClient, and alexaClientSDK::sampleApplications::ipcServerSampleApp::liveViewController::LiveViewControllerPresentationAdapter.


The documentation for this class was generated from the following file:

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0