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

#include <KeyWordObserverInterface.h>

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

Public Member Functions

virtual ~KeyWordObserverInterface ()=default
 
virtual void onKeyWordDetected (std::shared_ptr< avs::AudioInputStream > stream, std::string keyword, avs::AudioInputStream::Index beginIndex=UNSPECIFIED_INDEX, avs::AudioInputStream::Index endIndex=UNSPECIFIED_INDEX, std::shared_ptr< const std::vector< char >> KWDMetadata=nullptr)=0
 

Static Public Attributes

static constexpr avs::AudioInputStream::Index UNSPECIFIED_INDEX
 This represents when an index passed into the onKeyWordDetected() call should be ignored. More...
 

Detailed Description

A KeyWordObserverInterface is an interface class that clients can extend to listen for keyword detections.

Constructor & Destructor Documentation

◆ ~KeyWordObserverInterface()

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

Destructor.

Member Function Documentation

◆ onKeyWordDetected()

virtual void alexaClientSDK::avsCommon::sdkInterfaces::KeyWordObserverInterface::onKeyWordDetected ( std::shared_ptr< avs::AudioInputStream stream,
std::string  keyword,
avs::AudioInputStream::Index  beginIndex = UNSPECIFIED_INDEX,
avs::AudioInputStream::Index  endIndex = UNSPECIFIED_INDEX,
std::shared_ptr< const std::vector< char >>  KWDMetadata = nullptr 
)
pure virtual

Used to notify the observer of keyword detections. Once called, the client should return as soon as possible. Failure to do so might block the wake word engine from processing audio data, depending on which wake word engine is used. Any additional work that needs to be done should be done on a separate thread or after returning.

Parameters
streamThe stream in which the keyword was detected.
keywordThe keyword detected.
beginIndexThe optional absolute begin index of the first part of the keyword found within the stream. If this is set to UNSPECIFIED_INDEX, then it should be ignored.
endIndexThe optional absolute end index of the last part of the keyword within the stream of the stream. If this is set to UNSPECIFIED_INDEX, then it should be ignored.
KWDMetadataWake word engine metadata.

Member Data Documentation

◆ UNSPECIFIED_INDEX

constexpr avs::AudioInputStream::Index alexaClientSDK::avsCommon::sdkInterfaces::KeyWordObserverInterface::UNSPECIFIED_INDEX
static
Initial value:
=
std::numeric_limits<avs::AudioInputStream::Index>::max()

This represents when an index passed into the onKeyWordDetected() call should be ignored.


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