AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Member Functions | List of all members
alexaClientSDK::kwd::test::testKeyWordObserver Class Reference

A test observer that mocks out the KeyWordObserverInterface#onKeyWordDetected() call. More...

Inheritance diagram for alexaClientSDK::kwd::test::testKeyWordObserver:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::kwd::test::testKeyWordObserver:
Collaboration graph
[legend]

Classes

struct  detectionResult
 A struct used for bookkeeping of keyword detections. More...
 

Public Member Functions

void onKeyWordDetected (std::shared_ptr< AudioInputStream > stream, std::string keyword, AudioInputStream::Index beginIndex, AudioInputStream::Index endIndex, std::shared_ptr< const std::vector< char >> KWDMetadata)
 Implementation of the KeyWordObserverInterface#onKeyWordDetected() call. More...
 
std::vector< detectionResultwaitForNDetections (unsigned int numDetectionsExpected, std::chrono::milliseconds timeout)
 
- 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
 

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

A test observer that mocks out the KeyWordObserverInterface#onKeyWordDetected() call.

Member Function Documentation

◆ onKeyWordDetected()

void alexaClientSDK::kwd::test::testKeyWordObserver::onKeyWordDetected ( std::shared_ptr< AudioInputStream stream,
std::string  keyword,
AudioInputStream::Index  beginIndex,
AudioInputStream::Index  endIndex,
std::shared_ptr< const std::vector< char >>  KWDMetadata 
)
inline

Implementation of the KeyWordObserverInterface#onKeyWordDetected() call.

◆ waitForNDetections()

std::vector<detectionResult> alexaClientSDK::kwd::test::testKeyWordObserver::waitForNDetections ( unsigned int  numDetectionsExpected,
std::chrono::milliseconds  timeout 
)
inline

Waits for the KeyWordObserverInterface#onKeyWordDetected() call N times.

Parameters
numDetectionsExpectedThe number of detections expected.
timeoutThe amount of time to wait for the calls.
Returns
The detection results that actually occurred.

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

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