#include <KeyWordObserverInterface.h>
A KeyWordObserverInterface is an interface class that clients can extend to listen for keyword detections.
◆ ~KeyWordObserverInterface()
virtual alexaClientSDK::avsCommon::sdkInterfaces::KeyWordObserverInterface::~KeyWordObserverInterface |
( |
| ) |
|
|
virtualdefault |
◆ 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
-
stream | The stream in which the keyword was detected. |
keyword | The keyword detected. |
beginIndex | The 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. |
endIndex | The 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. |
KWDMetadata | Wake word engine metadata. |
◆ 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