![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Public Member Functions | |
RecognizeEvent (AudioProvider audioProvider, Initiator initiator, avsCommon::avs::AudioInputStream::Index begin=AudioInputProcessor::INVALID_INDEX, avsCommon::avs::AudioInputStream::Index keywordEnd=AudioInputProcessor::INVALID_INDEX, std::string keyword="", std::shared_ptr< std::string > avsInitiator=nullptr, const std::shared_ptr< std::vector< char >> KWDMetadata=nullptr, std::string expectedFormat="") | |
std::future< bool > | send (std::shared_ptr< AudioInputProcessor > audioInputProcessor) |
void | verifyJsonState (const avsCommon::avs::NamespaceAndName &, const std::string &jsonState, const avsCommon::avs::StateRefreshPolicy &, const unsigned int) |
void | verifyEspMessage (std::shared_ptr< avsCommon::avs::MessageRequest > request, const std::string &dialogRequestId) |
void | verifyMetadata (const std::shared_ptr< avsCommon::avs::MessageRequest > request, const std::shared_ptr< std::vector< char >> KWDMetadata) |
void | verifyMessage (std::shared_ptr< avsCommon::avs::MessageRequest > request, const std::vector< Sample > &pattern, const std::string &dialogRequestId, const std::string &expectedFormat="") |
std::vector< std::shared_ptr< avsCommon::avs::MessageRequest::NamedReader > > | getNamedReaders () |
Utility class which captures parameters to a Recognize event, and provides functions to send and verify the event using those parameters.
alexaClientSDK::capabilityAgents::aip::test::RecognizeEvent::RecognizeEvent | ( | AudioProvider | audioProvider, |
Initiator | initiator, | ||
avsCommon::avs::AudioInputStream::Index | begin = AudioInputProcessor::INVALID_INDEX , |
||
avsCommon::avs::AudioInputStream::Index | keywordEnd = AudioInputProcessor::INVALID_INDEX , |
||
std::string | keyword = "" , |
||
std::shared_ptr< std::string > | avsInitiator = nullptr , |
||
const std::shared_ptr< std::vector< char >> | KWDMetadata = nullptr , |
||
std::string | expectedFormat = "" |
||
) |
Constructs an object which captures the parameters to send in a Recognize Event. Parameters are passed through directly to AudioInputProcessor::recognize()
.
std::vector< std::shared_ptr< avsCommon::avs::MessageRequest::NamedReader > > alexaClientSDK::capabilityAgents::aip::test::RecognizeEvent::getNamedReaders | ( | ) |
Accessor function to get the attachment reader for a verified message.
std::future< bool > alexaClientSDK::capabilityAgents::aip::test::RecognizeEvent::send | ( | std::shared_ptr< AudioInputProcessor > | audioInputProcessor | ) |
This function sends a recognize event using the provided AudioInputProcessor
and the recognize parameters captured by this instance.
audioInputProcessor | The AudioInputProcessor to call AudioInputProcessor::recognize() on. |
true
if the call succeeded, else false
. void alexaClientSDK::capabilityAgents::aip::test::RecognizeEvent::verifyEspMessage | ( | std::shared_ptr< avsCommon::avs::MessageRequest > | request, |
const std::string & | dialogRequestId | ||
) |
void alexaClientSDK::capabilityAgents::aip::test::RecognizeEvent::verifyJsonState | ( | const avsCommon::avs::NamespaceAndName & | , |
const std::string & | jsonState, | ||
const avsCommon::avs::StateRefreshPolicy & | , | ||
const unsigned | int | ||
) |
This function verifies that the JSON state string is correct and matches the captured parameters. This function signature matches that of ContextManager::setState()
so that an EXPECT_CALL()
can Invoke()
this function directly, but only the jsonState parameter is verified by this function.
jsonState | The JSON context state string to verify. |
void alexaClientSDK::capabilityAgents::aip::test::RecognizeEvent::verifyMessage | ( | std::shared_ptr< avsCommon::avs::MessageRequest > | request, |
const std::vector< Sample > & | pattern, | ||
const std::string & | dialogRequestId, | ||
const std::string & | expectedFormat = "" |
||
) |
This function verifies that JSON content of a recognize MessageRequest
is correct, and that it has an attachment.
request | The MessageRequest to verify. |
pattern | Vector of samples holding a test pattern expected from the AudioInputStream . |
dialogRequestId | The expected dialogRequestId in the MessageRequest . |
void alexaClientSDK::capabilityAgents::aip::test::RecognizeEvent::verifyMetadata | ( | const std::shared_ptr< avsCommon::avs::MessageRequest > | request, |
const std::shared_ptr< std::vector< char >> | KWDMetadata | ||
) |
This function verifies the metadata AttachmentReader
created is correct
request | The MessageRequest to verify |
KWDMetadata | The Wakeword engine metadata recevied by AudioInputProcessor::recognize |
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0