AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::sampleApp::KeywordObserver Class Reference

#include <KeywordObserver.h>

Inheritance diagram for alexaClientSDK::sampleApp::KeywordObserver:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::sampleApp::KeywordObserver:
Collaboration graph
[legend]

Public Member Functions

 KeywordObserver (std::shared_ptr< defaultClient::DefaultClient > client, capabilityAgents::aip::AudioProvider audioProvider)
 
KeyWordObserverInterface Functions
void onKeyWordDetected (std::shared_ptr< avsCommon::avs::AudioInputStream > stream, std::string keyword, avsCommon::avs::AudioInputStream::Index beginIndex=UNSPECIFIED_INDEX, avsCommon::avs::AudioInputStream::Index endIndex=UNSPECIFIED_INDEX, std::shared_ptr< const std::vector< char >> KWDMetadata=nullptr) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::KeyWordObserverInterface
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 Member Functions

static std::shared_ptr< KeywordObservercreate (std::shared_ptr< defaultClient::DefaultClient > client, capabilityAgents::aip::AudioProvider audioProvider, std::shared_ptr< acsdkKWDImplementations::AbstractKeywordDetector > keywordDetector)
 

Additional Inherited Members

- Static Public Attributes inherited from alexaClientSDK::avsCommon::sdkInterfaces::KeyWordObserverInterface
static constexpr avs::AudioInputStream::Index UNSPECIFIED_INDEX
 This represents when an index passed into the onKeyWordDetected() call should be ignored. More...
 

Detailed Description

Observes callbacks from keyword detections and notifies the DefaultClient that a wake word has occurred.

Constructor & Destructor Documentation

◆ KeywordObserver()

alexaClientSDK::sampleApp::KeywordObserver::KeywordObserver ( std::shared_ptr< defaultClient::DefaultClient client,
capabilityAgents::aip::AudioProvider  audioProvider 
)

Constructor.

Parameters
clientThe default SDK client.
audioProviderThe audio provider from which to stream audio data from.

Member Function Documentation

◆ create()

static std::shared_ptr<KeywordObserver> alexaClientSDK::sampleApp::KeywordObserver::create ( std::shared_ptr< defaultClient::DefaultClient client,
capabilityAgents::aip::AudioProvider  audioProvider,
std::shared_ptr< acsdkKWDImplementations::AbstractKeywordDetector keywordDetector 
)
static

Creates a KeywordObserver and registers as an observer to a KeywordDetector.

Parameters
clientThe default SDK client.
audioProviderThe audio provider from which to stream audio data from.
keywordDetectorThe AbstractKeywordDetector to self register to as an observer.
Returns
a KeywordObserver.

◆ onKeyWordDetected()

void alexaClientSDK::sampleApp::KeywordObserver::onKeyWordDetected ( std::shared_ptr< avsCommon::avs::AudioInputStream stream,
std::string  keyword,
avsCommon::avs::AudioInputStream::Index  beginIndex = UNSPECIFIED_INDEX,
avsCommon::avs::AudioInputStream::Index  endIndex = UNSPECIFIED_INDEX,
std::shared_ptr< const std::vector< char >>  KWDMetadata = nullptr 
)
override

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