AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Typedefs | Functions | Variables
alexaClientSDK::capabilityAgents::aip::test Namespace Reference

Classes

class  AudioInputProcessorTest
 Test harness for AudioInputProcessor class. More...
 
class  MockBlockAudioEncoder
 Mock class that implements the BlockAudioEncoderInterface. More...
 
class  MockCapabilityConfigurationChangeObserver
 Mock class that implements the CapabilityConfigurationChangeObserverInterface. More...
 
class  MockExpectSpeechTimeoutHandler
 
class  MockObserver
 Mock class that implements the Observer. More...
 
class  RecognizeEvent
 
class  TestDialogUXStateObserver
 Class to monitor DialogUXStateAggregator for the THINKING state and automatically move it to IDLE. More...
 

Typedefs

using Bytes = audioEncoderInterfaces::BlockAudioEncoderInterface::Bytes
 Byte array for audio sample data passing. More...
 
using Sample = uint16_t
 Integral type of a sample. More...
 

Functions

static const std::chrono::seconds TEST_TIMEOUT (10)
 General timeout for tests to fail. More...
 
static const std::string COMPONENT_NAME ("AudioInputProcessor")
 Component name for power resource management. More...
 
static rapidjson::Document parseJson (const std::string &json)
 Utility function to parse a JSON document. More...
 
 MATCHER_P (IsSamePowerResource, id, "")
 A matcher to compare PowerResourceId. More...
 
static std::string getJsonString (const rapidjson::Value &container, const std::string &key)
 Utility function to look up a JSON string in a container. More...
 
static int64_t getJsonInt64 (const rapidjson::Value &container, const std::string &key)
 Utility function to look up a JSON 'long' in a container. More...
 
static bool getInitiatorFromDirective (const std::string directive, std::string *initiator)
 
 TEST_F (AudioInputProcessorTest, test_createWithoutDirectiveSequencer)
 Function to verify that AudioInputProcessor::create() errors out with an invalid DirectiveSequencerInterface. More...
 
 TEST_F (AudioInputProcessorTest, test_createWithoutMessageSender)
 Function to verify that AudioInputProcessor::create() errors out with an invalid MessageSenderInterface. More...
 
 TEST_F (AudioInputProcessorTest, test_createWithoutContextManager)
 Function to verify that AudioInputProcessor::create() errors out with an invalid ContextManagerInterface. More...
 
 TEST_F (AudioInputProcessorTest, test_createWithoutFocusManager)
 Function to verify that AudioInputProcessor::create() errors out with an invalid FocusManagerInterface. More...
 
 TEST_F (AudioInputProcessorTest, test_createWithoutStateAggregator)
 Function to verify that AudioInputProcessor::create() errors out with an invalid DialogUXStateAggregator. More...
 
 TEST_F (AudioInputProcessorTest, test_createWithoutExceptionSender)
 
 TEST_F (AudioInputProcessorTest, test_createWithoutUserInactivityMonitor)
 
 TEST_F (AudioInputProcessorTest, test_createWithoutCapabilityChangeNotifier)
 Function to verify that AudioInputProcessor::create() errors out with an invalid CapabilityChangeNotifier. More...
 
 TEST_F (AudioInputProcessorTest, test_createWithoutAudioProvider)
 Function to verify that AudioInputProcessor::create() succeeds with a null AudioProvider. More...
 
 TEST_F (AudioInputProcessorTest, test_createWithoutPowerResourceManager)
 Function to verify that AudioInputProcessor::create() succeeds with a null PowerResourceManagerInterface. More...
 
 TEST_F (AudioInputProcessorTest, test_createWithoutMetricRecorder)
 Function to verify that AudioInputProcessor::create() succeeds with a null MetricRecorderInterface. More...
 
 TEST_F (AudioInputProcessorTest, test_getConfiguration)
 Function to verify that AudioInputProcessor::getconfiguration() returns the expected configuration data. More...
 
 TEST_F (AudioInputProcessorTest, test_addRemoveObserver)
 
 TEST_F (AudioInputProcessorTest, test_recognizeNullStream)
 This function verifies that AudioInputProcessor::recognize() fails when given a null AudioProvider. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeInvalidAudioFormat)
 This function verifies that AudioInputProcessor::recognize() fails when given invalid AudioFormats. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizePressAndHold)
 This function verifies that AudioInputProcessor::recognize() works with Initiator::PRESS_AND_HOLD. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeTap)
 This function verifies that AudioInputProcessor::recognize() works with Initiator::TAP. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordWithoutKeyword)
 This function verifies that AudioInputProcessor::recognize() fails with Initiator::WAKEWORD and no keyword. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordWithBadBegin)
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordWithKeyword)
 This function verifies that AudioInputProcessor::recognize() works with Initiator::WAKEWORD and keyword. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordWithGoodBegin)
 This function verifies that AudioInputProcessor::recognize() works with Initiator::WAKEWORD valid begin. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordWithGoodBeginAndEnd)
 
 TEST_F (AudioInputProcessorTest, test_recognizeCloseTalk)
 This function verifies that AudioInputProcessor::recognize() works with ASRProfile::CLOSE_TALK. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeNearField)
 This function verifies that AudioInputProcessor::recognize() works with ASRProfile::NEAR_FIELD. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeFarField)
 This function verifies that AudioInputProcessor::recognize() works with ASRProfile::FAR_FIELD. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeFarFieldWithEncoder)
 Test if AudioInputProcessor::recognize() works with an audio encoder. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeFarFieldWithEncoderDisabled)
 Test if AudioInputProcessor::recognize() works with an audio encoder. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeFarFieldWithEncoderReEnabled)
 Test if AudioInputProcessor::recognize() works with an audio encoder. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeWhileExpectingSpeech)
 This function verifies that AudioInputProcessor::recognize() works in State::EXPECTING_SPEECH. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeStopAfterRecognize)
 
 TEST_F (AudioInputProcessorTest, test_recognizeStopAfterContext)
 
 TEST_F (AudioInputProcessorTest, test_recognizeStopAfterFocus)
 
 TEST_F (AudioInputProcessorTest, test_recognizeStopAfterSend)
 
 TEST_F (AudioInputProcessorTest, test_recognizeBargeInWhileRecognizingCloseTalk)
 
 TEST_F (AudioInputProcessorTest, test_recognizeBargeInWhileRecognizingNearField)
 
 TEST_F (AudioInputProcessorTest, test_recognizeBargeInWhileRecognizingFarField)
 
 TEST_F (AudioInputProcessorTest, test_recognizeBargeInWhileRecognizingCantOverride)
 
 TEST_F (AudioInputProcessorTest, test_recognizeBargeInWhileRecognizingCantBeOverridden)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureWhenIdle)
 This function verifies that AudioInputProcessor::stopCapture() fails in State::IDLE. More...
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureWhenExpectingSpeech)
 This function verifies that AudioInputProcessor::stopCapture() fails in State::EXPECTING_SPEECH. More...
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureWhenRecognizing)
 This function verifies that AudioInputProcessor::stopCapture() works in State::RECOGNIZING. More...
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureWhenRecognizingFollowByStopCaptureDirective)
 
 TEST_F (AudioInputProcessorTest, test_resetStateWhenIdle)
 This function verifies that AudioInputProcessor::resetState() works in State::IDLE. More...
 
 TEST_F (AudioInputProcessorTest, test_resetStateWhenExpectingSpeech)
 This function verifies that AudioInputProcessor::resetState() works in State::EXPECTING_SPEECH. More...
 
 TEST_F (AudioInputProcessorTest, test_resetStateWhenRecognizing)
 This function verifies that AudioInputProcessor::resetState() works in State::RECOGNIZING. More...
 
 TEST_F (AudioInputProcessorTest, test_contextFailureStateProviderTimedout)
 
 TEST_F (AudioInputProcessorTest, test_contextFailureBuildContextError)
 
 TEST_F (AudioInputProcessorTest, test_preHandleAndHandleDirectiveStopCaptureWhenIdle)
 This function verifies that StopCapture directives fail in State::IDLE. More...
 
 TEST_F (AudioInputProcessorTest, test_preHandleAndHandleDirectiveStopCaptureWhenRecognizing)
 This function verifies that StopCapture directives with dialog request ID work in State::RECOGNIZING. More...
 
 TEST_F (AudioInputProcessorTest, test_preHandleAndHandleDirectiveStopCaptureWhenExpectingSpeech)
 This function verifies that StopCapture directives fail in State::EXPECTING_SPEECH. More...
 
 TEST_F (AudioInputProcessorTest, test_handleDirectiveImmediatelyStopCaptureWhenRecognizing)
 This function verifies that StopCapture directives without dialog request ID work in State::RECOGNIZING. More...
 
 TEST_F (AudioInputProcessorTest, test_preHandleAndHandleDirectiveExpectSpeechWhenIdle)
 This function verifies that ExpectSpeech directives with dialog request ID work in State::IDLE. More...
 
 TEST_F (AudioInputProcessorTest, test_handleDirectiveImmediatelyExpectSpeechWhenIdle)
 This function verifies that ExpectSpeech directives without dialog request ID work in State::IDLE. More...
 
 TEST_F (AudioInputProcessorTest, test_preHandleAndHandleDirectiveExpectSpeechWhenRecognizing)
 This function verifies that ExpectSpeech directives fail in State::RECOGNIZING. More...
 
 TEST_F (AudioInputProcessorTest, test_preHandleAndHandleDirectiveExpectSpeechWhenExpectingSpeech)
 This function verifies that ExpectSpeech directives fail in State::EXPECTING_SPEECH. More...
 
 TEST_F (AudioInputProcessorTest, test_expectSpeechNoDefaultNoPrevious)
 This function verifies that ExpectSpeech directives wait with no default and no previous AudioProvider. More...
 
 TEST_F (AudioInputProcessorTest, test_expectSpeechUnreadableDefaultNoPrevious)
 This function verifies that ExpectSpeech directives wait with unreadable default and no previous AudioProvider. More...
 
 TEST_F (AudioInputProcessorTest, test_expectSpeechUnreadableDefaultUnreadablePrevious)
 
 TEST_F (AudioInputProcessorTest, test_expectSpeechNoDefaultReadablePrevious)
 This function verifies that ExpectSpeech directives work with no default and readable previous AudioProvider. More...
 
 TEST_F (AudioInputProcessorTest, test_expectSpeechWithInitiator)
 This function verifies that the initiator from an ExpectSpeech is passed to a subsequent Recognize. More...
 
 TEST_F (AudioInputProcessorTest, test_expectSpeechWithNoInitiator)
 
 TEST_F (AudioInputProcessorTest, test_expectSpeechWithInitiatorTimedOut)
 
 TEST_F (AudioInputProcessorTest, handleExpectSpeechTimeoutExternallyWithTimeout)
 
 TEST_F (AudioInputProcessorTest, handleExpectSpeechTimeoutExternallyWithoutTimeout)
 
 TEST_F (AudioInputProcessorTest, handleExpectSpeechTimeoutInternallyWithAlwaysReadableAudioProviderResultsInRecognize)
 
 TEST_F (AudioInputProcessorTest, handleExpectSpeechTimeoutExternallyWithAlwaysReadableAudioProviderResultsInRecognize)
 
 TEST_F (AudioInputProcessorTest, test_focusChangedBackground)
 
 TEST_F (AudioInputProcessorTest, test_focusChangedNone)
 
 TEST_F (AudioInputProcessorTest, test_resetStateOnTimeOut)
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordWithESPWithKeyword)
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordWithInvalidESPWithKeyword)
 
 TEST_F (AudioInputProcessorTest, test_recognizeOPUSWithTap)
 
 TEST_F (AudioInputProcessorTest, test_recognizeOPUSWithPressAndHold)
 
 TEST_F (AudioInputProcessorTest, test_recognizeOPUSWithWakeWord)
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordWithKWDMetadata)
 
 TEST_F (AudioInputProcessorTest, test_recognizeInvalidWakeWord)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamSuccessBeforeClose)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamSuccess)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamSuccessNoContentBeforeClose)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamPendingBeforeClose)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamSuccessNoContent)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamSuccessNotConnected)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamNotSynchronized)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamInternalrror)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamProtocolError)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamServerInternalError)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamRefused)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamCanceled)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamThrottled)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamInvalidAuth)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamBadRequest)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamUnknownServerError)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamSuccess)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamSuccessNoContent)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamSuccessNotConnected)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamNotSynchronized)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamInternalrror)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamProtocolError)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamServerInternalError)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamRefused)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamCanceled)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamThrottled)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamInvalidAuth)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamBadRequest)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnDirectiveAndStreamUnknownServerError)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamSuccessAndDirectiveBeforeClose)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamSuccessAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamSuccessNoContentAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamSuccessNotConnectedAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamNotSynchronizedAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamInternalrrorAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamProtocolErrorAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamServerInternalErrorAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamRefusedAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamCanceledAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamThrottledAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamInvalidAuthAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamBadRequestAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureOnStreamUnknownServerErrorAndDirective)
 
 TEST_F (AudioInputProcessorTest, test_handleSetEndOfSpeechOffsetSuccess)
 
 TEST_F (AudioInputProcessorTest, test_handleSetEndOfSpeechOffsetFailureInvalid)
 
 TEST_F (AudioInputProcessorTest, test_handleSetEndOfSpeechOffsetFailureMissing)
 
 TEST_F (AudioInputProcessorTest, test_handleSetWakeWordConfirmation)
 
 TEST_F (AudioInputProcessorTest, test_setSpeechConfirmation)
 
 TEST_F (AudioInputProcessorTest, test_setWakeWordsDirectiveSuccess)
 
 TEST_F (AudioInputProcessorTest, test_publishedCapabiltiesContainsSupportedWakeWords)
 
 TEST_F (AudioInputProcessorTest, test_localeAssetsChanged)
 
 TEST_F (AudioInputProcessorTest, test_requestEncodingAudioFormatsSuccess)
 
 TEST_F (AudioInputProcessorTest, test_requestEncodingAudioFormatsWithFallbackAndUnsupportedFormats)
 
 TEST_F (AudioInputProcessorTest, test_requestEncodingAudioFormatsFails)
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordWithKeywordForMultiStreams)
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordWithMetadataForMultipleAudioStreams)
 This function verifies that recognize() works with KWD metadata for multiple audio streams. More...
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordStopAfterSendForMultiStreams)
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordStopAfterRecognizeForMultiStreams)
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordStopAfterContextForMultiStreams)
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordStopCaptureAfterFocusForMultiStreams)
 
 TEST_F (AudioInputProcessorTest, test_recognizeWakewordWithGoodBeginAndEndForMultiStreams)
 
 TEST_F (AudioInputProcessorTest, test_recognizeBargeInWhileRecognizingCloseTalkForMultiStreams)
 
 TEST_F (AudioInputProcessorTest, test_stopCaptureWhenRecognizingForMultiStreams)
 
 TEST_F (AudioInputProcessorTest, test_recognizeWorksWithOneFormatInRequestEncodingAudioFormats)
 

Variables

static const std::string CHANNEL_NAME = avsCommon::sdkInterfaces::FocusManagerInterface::DIALOG_CHANNEL_NAME
 The name of the FocusManager channel used by AudioInputProvider. More...
 
static const std::string NAMESPACE = "SpeechRecognizer"
 The namespace for this capability agent. More...
 
static const avsCommon::avs::NamespaceAndName STOP_CAPTURE {NAMESPACE, "StopCapture"}
 The StopCapture directive signature. More...
 
static const avsCommon::avs::NamespaceAndName EXPECT_SPEECH {NAMESPACE, "ExpectSpeech"}
 The ExpectSpeech directive signature. More...
 
static const avsCommon::avs::NamespaceAndName SET_END_OF_SPEECH_OFFSET {NAMESPACE, "SetEndOfSpeechOffset"}
 The SetEndOfSpeechOffset directive signature. More...
 
static const avsCommon::avs::NamespaceAndName SET_WAKE_WORD_CONFIRMATION {NAMESPACE, "SetWakeWordConfirmation"}
 The SetWakeWordConfirmation directive signature. More...
 
static const avsCommon::avs::NamespaceAndName SET_SPEECH_CONFIRMATION {NAMESPACE, "SetSpeechConfirmation"}
 The SetSpeechConfirmation directive signature. More...
 
static const avsCommon::avs::NamespaceAndName SET_WAKE_WORDS {NAMESPACE, "SetWakeWords"}
 The SetWakeWords directive signature. More...
 
static const avsCommon::avs::NamespaceAndName DIRECTIVES []
 The directives AudioInputProcessor should handle. More...
 
static const avsCommon::avs::NamespaceAndName RECOGNIZER_STATE {NAMESPACE, "RecognizerState"}
 The SpeechRecognizer context state signature. More...
 
static const unsigned int SAMPLE_RATE_HZ = 16000
 Sample rate for audio input stream. More...
 
static const size_t SDS_WORDSIZE = sizeof(Sample)
 Number of bytes per word in the SDS circular buffer. More...
 
static const unsigned int SAMPLE_SIZE_IN_BITS = SDS_WORDSIZE * CHAR_BIT
 Sample size for audio input stream. More...
 
static const unsigned int NUM_CHANNELS = 1
 Number of channels in audio input stream. More...
 
static const std::chrono::milliseconds PREROLL_MS = std::chrono::milliseconds(500)
 Number of milliseconds of preroll applied for cloud-based wakeword verification. More...
 
static const size_t PREROLL_WORDS = (SAMPLE_RATE_HZ / 1000) * PREROLL_MS.count()
 Number of words of preroll. More...
 
static const size_t WAKEWORD_WORDS = PREROLL_WORDS
 Number of words in wakeword. More...
 
static const size_t SDS_WORDS = PREROLL_WORDS + WAKEWORD_WORDS + 1000
 Number of words to hold in the SDS circular buffer. More...
 
static const size_t PATTERN_WORDS = SDS_WORDS / 2
 Number of test pattern words to write to the SDS circular buffer. More...
 
static const size_t SDS_MAXREADERS = 10
 Maximum number of readers to support in the SDS circular buffer. More...
 
static const bool ALWAYS_READABLE = true
 Boolean value to indicate an AudioProvider is always readable. More...
 
static const bool CAN_OVERRIDE = true
 Boolean value to indicate an AudioProvider can override another AudioProvider. More...
 
static const bool CAN_BE_OVERRIDDEN = true
 Boolean value to indicate an AudioProvider can be overridden by another AudioProvider. More...
 
static const std::string MESSAGE_CONTEXT_KEY = "context"
 JSON key for the context section of a message. More...
 
static const std::string MESSAGE_EVENT_KEY = "event"
 JSON key for the event section of a message. More...
 
static const std::string MESSAGE_DIRECTIVE_KEY = "directive"
 JSON key for the directive section of a message. More...
 
static const std::string MESSAGE_HEADER_KEY = "header"
 JSON key for the header section of a message. More...
 
static const std::string MESSAGE_PAYLOAD_KEY = "payload"
 JSON key for the payload section of an message. More...
 
static const std::string MESSAGE_NAMESPACE_KEY = "namespace"
 JSON key for the namespace field of a message header. More...
 
static const std::string MESSAGE_NAME_KEY = "name"
 JSON key for the name field of a message header. More...
 
static const std::string MESSAGE_MESSAGE_ID_KEY = "messageId"
 JSON key for the message ID field of a message header. More...
 
static const std::string MESSAGE_DIALOG_REQUEST_ID_KEY = "dialogRequestId"
 JSON key for the dialog request ID field of a message header. More...
 
static const std::string RECOGNIZE_EVENT_NAME = "Recognize"
 JSON value for a recognize event's name. More...
 
static const std::string ASR_PROFILE_KEY = "profile"
 JSON key for the ASR profile field of a recognize event. More...
 
static const std::string AUDIO_FORMAT_KEY = "format"
 JSON key for the audio format field of a recognize event. More...
 
static const std::string AUDIO_FORMAT_OPUS = "OPUS"
 JSON value for audio format OPUS. More...
 
static const std::string AUDIO_FORMAT_LPCM = "AUDIO_L16_RATE_16000_CHANNELS_1"
 JSON value for audio format LPCM. More...
 
static const std::unordered_set< std::string > AUDIO_FORMAT_VALUES = {AUDIO_FORMAT_LPCM, AUDIO_FORMAT_OPUS}
 Accepted JSON values for a recognize event's audio format. More...
 
static const std::string RECOGNIZE_INITIATOR_KEY = "initiator"
 JSON key for the initiator field of a recognize event. More...
 
static const std::string INITIATOR_TYPE_KEY = "type"
 JSON key for the type field of a recognize event's initiator. More...
 
static const std::string INITIATOR_PAYLOAD_KEY = "payload"
 JSON key for the type field of a recognize event's payload. More...
 
static const std::string WAKE_WORD_INDICES_KEY = "wakeWordIndices"
 JSON key for the wakeword indices field of a wakeword recognize event's payload. More...
 
static const std::string START_INDEX_KEY = "startIndexInSamples"
 JSON key for the start index field of a wakeword recognize event's payload. More...
 
static const std::string END_INDEX_KEY = "endIndexInSamples"
 JSON key for the end index field of a wakeword recognize event's payload. More...
 
static const std::string EXPECT_SPEECH_INITIATOR = R"({"opaque":"expectSpeechInitiator"})"
 Value used in the tests for an expect speech initiator. More...
 
static const std::string EXPECT_SPEECH_TIMEOUT_KEY = "timeoutInMilliseconds"
 JSON key for the timeout field of an expect speech directive. More...
 
static const int64_t EXPECT_SPEECH_TIMEOUT_IN_MILLISECONDS = 100
 Value used in the tests for an expect speech timeout. More...
 
static const std::string EXPECT_SPEECH_INITIATOR_KEY = "initiator"
 JSON key for the initiator field of an expect speech directive. More...
 
static const std::string EXPECT_SPEECH_TIMED_OUT_EVENT_NAME = "ExpectSpeechTimedOut"
 JSON value for a expect speech timed out event's name. More...
 
static const std::string KEYWORD_TEXT = "ALEXA"
 Value used in the tests for a wakeword recognize event. More...
 
static const bool WITH_DIALOG_REQUEST_ID = true
 Boolean value to indicate a directive being tested has a dialog request ID. More...
 
static const bool VERIFY_TIMEOUT = true
 Boolean value to indicate an expect speech directive should time out. More...
 
static const std::string ESP_EVENT_NAME = "ReportEchoSpatialPerceptionData"
 JSON value for a ReportEchoSpatialPerceptionData event's name. More...
 
static const std::string ESP_VOICE_ENERGY_KEY = "voiceEnergy"
 JSON key for the voice energy field of a ReportEchoSpatialPerceptionData event. More...
 
static const std::string ESP_AMBIENT_ENERGY_KEY = "ambientEnergy"
 JSON key for the ambient energy field of a ReportEchoSpatialPerceptionData event. More...
 
static const std::string AUDIO_ATTACHMENT_FIELD_NAME = "audio"
 The field name for the user voice attachment. More...
 
static const std::string KWD_METADATA_FIELD_NAME = "wakewordEngineMetadata"
 The field name for the wake word engine metadata. More...
 
static const std::string WAKEWORD_FIELD_NAME = "wakeWord"
 The field name for the wake word detected. More...
 
static const std::string END_OF_SPEECH_OFFSET_FIELD_NAME = "endOfSpeechOffsetInMilliseconds"
 
static const int64_t END_OF_SPEECH_OFFSET_IN_MILLISECONDS = 1526
 Value used in the tests for an end of speech offset. More...
 
static const std::string START_OF_SPEECH_TIMESTAMP_FIELD_NAME = "startOfSpeechTimestamp"
 
static const auto START_OF_SPEECH_TIMESTAMP = std::chrono::steady_clock::now()
 Value used in the tests for an start of speech timestamp. More...
 
static const auto START_OF_SPEECH_TIMESTAMP_STR = std::to_string(START_OF_SPEECH_TIMESTAMP.time_since_epoch().count())
 String value used for start of speech timestamp string representation. More...
 
static const size_t MESSAGE_ATTACHMENT_KWD_METADATA_INDEX = 0
 The index of the Wakeword engine metadata in the MessageRequest. More...
 
static const std::string KWD_METADATA_EXAMPLE = "Wakeword engine metadata example"
 Sample Wakeword engine metadata to compare with the @ AttachmentReader. More...
 
static const std::string WAKE_WORD_CONFIRMATION_PAYLOAD_KEY = "wakeWordConfirmation"
 The value of the payload key for wakeWordConfirmation. More...
 
static const std::string SPEECH_CONFIRMATION_PAYLOAD_KEY = "speechConfirmation"
 The value of the payload key for speechConfirmation. More...
 
static const std::string WAKEWORDS_PAYLOAD_KEY = "wakeWords"
 The value of the payload key for wake words. More...
 
static const std::set< std::string > SUPPORTED_WAKE_WORDS = {"ALEXA", "ECHO"}
 A list of test supported wake words. More...
 
static const std::map< std::string, std::set< std::set< std::string > > > SUPPORTED_LOCALE_SPECIFIC_WAKEWORDS
 A list of test supported locale specific wakewords. More...
 
static const std::set< std::string > SUPPORTED_LOCALES = {"en-CA", "en-US"}
 A list of test supported locales. More...
 
static const std::string DEFAULT_LOCALE = "en-CA"
 Default locale. More...
 
static const std::string CAPABILITY_INTERFACE_CONFIGURATIONS_KEY = "configurations"
 Capability configuration key used to give more details about the device configuration. More...
 
static const ContextRequestToken CONTEXT_REQUEST_TOKEN {1}
 
static const AudioInputProcessor::EncodingFormatRequest ENCODING_FORMAT_REQ
 Request to configure AIP to produce multiple audio streams with different encoding formats. More...
 
static const AudioInputProcessor::EncodingFormatResponse ENCODING_FORMAT_RSP
 Response for the request to AIP to produce multiple audio streams. More...
 
static const std::map< std::string, std::string > EXPECTED_ENCODING_FORMATS
 Expected resolve key to encoding format strings. More...
 

Typedef Documentation

◆ Bytes

Byte array for audio sample data passing.

◆ Sample

Integral type of a sample.

Function Documentation

◆ COMPONENT_NAME()

static const std::string alexaClientSDK::capabilityAgents::aip::test::COMPONENT_NAME ( "AudioInputProcessor"  )
static

Component name for power resource management.

◆ getInitiatorFromDirective()

static bool alexaClientSDK::capabilityAgents::aip::test::getInitiatorFromDirective ( const std::string  directive,
std::string *  initiator 
)
static

◆ getJsonInt64()

static int64_t alexaClientSDK::capabilityAgents::aip::test::getJsonInt64 ( const rapidjson::Value &  container,
const std::string &  key 
)
static

Utility function to look up a JSON 'long' in a container.

◆ getJsonString()

static std::string alexaClientSDK::capabilityAgents::aip::test::getJsonString ( const rapidjson::Value &  container,
const std::string &  key 
)
static

Utility function to look up a JSON string in a container.

◆ MATCHER_P()

alexaClientSDK::capabilityAgents::aip::test::MATCHER_P ( IsSamePowerResource  ,
id  ,
""   
)

A matcher to compare PowerResourceId.

◆ parseJson()

static rapidjson::Document alexaClientSDK::capabilityAgents::aip::test::parseJson ( const std::string &  json)
static

Utility function to parse a JSON document.

◆ TEST_F() [1/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_createWithoutDirectiveSequencer   
)

Function to verify that AudioInputProcessor::create() errors out with an invalid DirectiveSequencerInterface.

◆ TEST_F() [2/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_createWithoutMessageSender   
)

Function to verify that AudioInputProcessor::create() errors out with an invalid MessageSenderInterface.

◆ TEST_F() [3/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_createWithoutContextManager   
)

Function to verify that AudioInputProcessor::create() errors out with an invalid ContextManagerInterface.

◆ TEST_F() [4/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_createWithoutFocusManager   
)

Function to verify that AudioInputProcessor::create() errors out with an invalid FocusManagerInterface.

◆ TEST_F() [5/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_createWithoutStateAggregator   
)

Function to verify that AudioInputProcessor::create() errors out with an invalid DialogUXStateAggregator.

◆ TEST_F() [6/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_createWithoutExceptionSender   
)

Function to verify that AudioInputProcessor::create() errors out with an invalid ExceptionEncounteredSenderInterface.

◆ TEST_F() [7/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_createWithoutUserInactivityMonitor   
)

Function to verify that AudioInputProcessor::create() errors out with an invalid UserInactivityMonitorInterface.

◆ TEST_F() [8/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_createWithoutCapabilityChangeNotifier   
)

Function to verify that AudioInputProcessor::create() errors out with an invalid CapabilityChangeNotifier.

◆ TEST_F() [9/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_createWithoutAudioProvider   
)

Function to verify that AudioInputProcessor::create() succeeds with a null AudioProvider.

◆ TEST_F() [10/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_createWithoutPowerResourceManager   
)

Function to verify that AudioInputProcessor::create() succeeds with a null PowerResourceManagerInterface.

◆ TEST_F() [11/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_createWithoutMetricRecorder   
)

Function to verify that AudioInputProcessor::create() succeeds with a null MetricRecorderInterface.

◆ TEST_F() [12/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_getConfiguration   
)

Function to verify that AudioInputProcessor::getconfiguration() returns the expected configuration data.

◆ TEST_F() [13/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_addRemoveObserver   
)

Function to verify that observers can be added/removed. Nothing is directly asserted here, but this test verifies that these functions work without crashing.

◆ TEST_F() [14/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeNullStream   
)

This function verifies that AudioInputProcessor::recognize() fails when given a null AudioProvider.

◆ TEST_F() [15/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeInvalidAudioFormat   
)

This function verifies that AudioInputProcessor::recognize() fails when given invalid AudioFormats.

◆ TEST_F() [16/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizePressAndHold   
)

This function verifies that AudioInputProcessor::recognize() works with Initiator::PRESS_AND_HOLD.

◆ TEST_F() [17/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeTap   
)

This function verifies that AudioInputProcessor::recognize() works with Initiator::TAP.

◆ TEST_F() [18/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordWithoutKeyword   
)

This function verifies that AudioInputProcessor::recognize() fails with Initiator::WAKEWORD and no keyword.

◆ TEST_F() [19/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordWithBadBegin   
)

This function verifies that AudioInputProcessor::recognize() fails with Initiator::WAKEWORD and invalid begin index.

◆ TEST_F() [20/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordWithKeyword   
)

This function verifies that AudioInputProcessor::recognize() works with Initiator::WAKEWORD and keyword.

◆ TEST_F() [21/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordWithGoodBegin   
)

This function verifies that AudioInputProcessor::recognize() works with Initiator::WAKEWORD valid begin.

◆ TEST_F() [22/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordWithGoodBeginAndEnd   
)

This function verifies that AudioInputProcessor::recognize() works with Initiator::WAKEWORD valid begin and end indices.

◆ TEST_F() [23/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeCloseTalk   
)

This function verifies that AudioInputProcessor::recognize() works with ASRProfile::CLOSE_TALK.

◆ TEST_F() [24/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeNearField   
)

This function verifies that AudioInputProcessor::recognize() works with ASRProfile::NEAR_FIELD.

◆ TEST_F() [25/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeFarField   
)

This function verifies that AudioInputProcessor::recognize() works with ASRProfile::FAR_FIELD.

◆ TEST_F() [26/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeFarFieldWithEncoder   
)

Test if AudioInputProcessor::recognize() works with an audio encoder.

◆ TEST_F() [27/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeFarFieldWithEncoderDisabled   
)

Test if AudioInputProcessor::recognize() works with an audio encoder.

◆ TEST_F() [28/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeFarFieldWithEncoderReEnabled   
)

Test if AudioInputProcessor::recognize() works with an audio encoder.

◆ TEST_F() [29/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWhileExpectingSpeech   
)

This function verifies that AudioInputProcessor::recognize() works in State::EXPECTING_SPEECH.

◆ TEST_F() [30/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeStopAfterRecognize   
)

This function verifies that AudioInputProcessor::recognize() works with a call to stopCapture() immediately after the recognize() call.

◆ TEST_F() [31/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeStopAfterContext   
)

This function verifies that AudioInputProcessor::recognize() works with a call to stopCapture() immediately after the onContextAvailable() call.

◆ TEST_F() [32/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeStopAfterFocus   
)

This function verifies that AudioInputProcessor::recognize() works with a call to stopCapture() immediately after the onFocusChanged() call.

◆ TEST_F() [33/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeStopAfterSend   
)

This function verifies that AudioInputProcessor::recognize() works with a call to stopCapture() immediately after the message is sent.

◆ TEST_F() [34/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeBargeInWhileRecognizingCloseTalk   
)

This function verifies that AudioInputProcessor::recognize() works in State::RECOGNIZING when the previous recognize used the CLOSE_TALK profile.

◆ TEST_F() [35/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeBargeInWhileRecognizingNearField   
)

This function verifies that AudioInputProcessor::recognize() works in State::RECOGNIZING when the previous recognize used the NEAR_FIELD profile.

◆ TEST_F() [36/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeBargeInWhileRecognizingFarField   
)

This function verifies that AudioInputProcessor::recognize() works in State::RECOGNIZING when the previous recognize used the FAR_FIELD profile.

◆ TEST_F() [37/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeBargeInWhileRecognizingCantOverride   
)

This function verifies that AudioInputProcessor::recognize() fails in State::RECOGNIZING when the second AudioProvider can't override.

◆ TEST_F() [38/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeBargeInWhileRecognizingCantBeOverridden   
)

This function verifies that AudioInputProcessor::recognize() fails in State::RECOGNIZING when the first AudioProvider can't be overridden.

◆ TEST_F() [39/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureWhenIdle   
)

This function verifies that AudioInputProcessor::stopCapture() fails in State::IDLE.

◆ TEST_F() [40/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureWhenExpectingSpeech   
)

This function verifies that AudioInputProcessor::stopCapture() fails in State::EXPECTING_SPEECH.

◆ TEST_F() [41/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureWhenRecognizing   
)

This function verifies that AudioInputProcessor::stopCapture() works in State::RECOGNIZING.

◆ TEST_F() [42/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureWhenRecognizingFollowByStopCaptureDirective   
)

◆ TEST_F() [43/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_resetStateWhenIdle   
)

This function verifies that AudioInputProcessor::resetState() works in State::IDLE.

◆ TEST_F() [44/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_resetStateWhenExpectingSpeech   
)

This function verifies that AudioInputProcessor::resetState() works in State::EXPECTING_SPEECH.

◆ TEST_F() [45/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_resetStateWhenRecognizing   
)

This function verifies that AudioInputProcessor::resetState() works in State::RECOGNIZING.

◆ TEST_F() [46/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_contextFailureStateProviderTimedout   
)

This function verifies that AudioInputProcessor responds correctly to ContextRequestError::STATE_PROVIDER_TIMEDOUT.

◆ TEST_F() [47/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_contextFailureBuildContextError   
)

This function verifies that AudioInputProcessor responds correctly to ContextRequestError::BUILD_CONTEXT_ERROR.

◆ TEST_F() [48/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_preHandleAndHandleDirectiveStopCaptureWhenIdle   
)

This function verifies that StopCapture directives fail in State::IDLE.

◆ TEST_F() [49/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_preHandleAndHandleDirectiveStopCaptureWhenRecognizing   
)

This function verifies that StopCapture directives with dialog request ID work in State::RECOGNIZING.

◆ TEST_F() [50/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_preHandleAndHandleDirectiveStopCaptureWhenExpectingSpeech   
)

This function verifies that StopCapture directives fail in State::EXPECTING_SPEECH.

◆ TEST_F() [51/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_handleDirectiveImmediatelyStopCaptureWhenRecognizing   
)

This function verifies that StopCapture directives without dialog request ID work in State::RECOGNIZING.

◆ TEST_F() [52/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_preHandleAndHandleDirectiveExpectSpeechWhenIdle   
)

This function verifies that ExpectSpeech directives with dialog request ID work in State::IDLE.

◆ TEST_F() [53/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_handleDirectiveImmediatelyExpectSpeechWhenIdle   
)

This function verifies that ExpectSpeech directives without dialog request ID work in State::IDLE.

◆ TEST_F() [54/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_preHandleAndHandleDirectiveExpectSpeechWhenRecognizing   
)

This function verifies that ExpectSpeech directives fail in State::RECOGNIZING.

◆ TEST_F() [55/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_preHandleAndHandleDirectiveExpectSpeechWhenExpectingSpeech   
)

This function verifies that ExpectSpeech directives fail in State::EXPECTING_SPEECH.

◆ TEST_F() [56/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_expectSpeechNoDefaultNoPrevious   
)

This function verifies that ExpectSpeech directives wait with no default and no previous AudioProvider.

◆ TEST_F() [57/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_expectSpeechUnreadableDefaultNoPrevious   
)

This function verifies that ExpectSpeech directives wait with unreadable default and no previous AudioProvider.

◆ TEST_F() [58/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_expectSpeechUnreadableDefaultUnreadablePrevious   
)

This function verifies that ExpectSpeech directives wait with unreadable default and unreadable previous AudioProvider.

◆ TEST_F() [59/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_expectSpeechNoDefaultReadablePrevious   
)

This function verifies that ExpectSpeech directives work with no default and readable previous AudioProvider.

◆ TEST_F() [60/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_expectSpeechWithInitiator   
)

This function verifies that the initiator from an ExpectSpeech is passed to a subsequent Recognize.

◆ TEST_F() [61/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_expectSpeechWithNoInitiator   
)

This function verifies that if the ExpectSpeech does not have an initiator, no initiator is present in the subsequent Recognize.

◆ TEST_F() [62/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_expectSpeechWithInitiatorTimedOut   
)

This function verifies that if the ExpectSpeech times out, the next user initiated Recognize will send the standard initiator and not the one passed from AVS.

◆ TEST_F() [63/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
handleExpectSpeechTimeoutExternallyWithTimeout   
)

This function verifies that ExpectSpeech directives can be handled externally and that AIP may be notified back of an ExpectSpeech timeout with an AudioProvider that is not always readable.

◆ TEST_F() [64/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
handleExpectSpeechTimeoutExternallyWithoutTimeout   
)

This function verifies that ExpectSpeech directives can be handled externally and that AIP remains in an EXPECTING_SPEECH state if no call is made back to AIP to notify of an ExpectSpeech timeout with an AudioProvider that is not always readable.

◆ TEST_F() [65/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
handleExpectSpeechTimeoutInternallyWithAlwaysReadableAudioProviderResultsInRecognize   
)

This function verifies that ExpectSpeech directives that are not handled externally with an always readable AudioProvider will result in an automatic transition to RECOGNIZING.

◆ TEST_F() [66/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
handleExpectSpeechTimeoutExternallyWithAlwaysReadableAudioProviderResultsInRecognize   
)

This function verifies that ExpectSpeech directives that are handled externally with an always readable AudioProvider will result in an automatic transition to RECOGNIZING.

◆ TEST_F() [67/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_focusChangedBackground   
)

This function verifies that a focus change to FocusState::BACKGROUND causes the AudioInputProcessor to release the channel and go back to State::IDLE.

◆ TEST_F() [68/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_focusChangedNone   
)

This function verifies that a focus change to FocusState::NONE causes the AudioInputProcessor to release the channel and go back to State::IDLE.

◆ TEST_F() [69/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_resetStateOnTimeOut   
)

Test that the AudioInputProcessor correctly transitions to State::IDLE if Status::TIMEDOUT is received

◆ TEST_F() [70/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordWithESPWithKeyword   
)

◆ TEST_F() [71/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordWithInvalidESPWithKeyword   
)

◆ TEST_F() [72/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeOPUSWithTap   
)

◆ TEST_F() [73/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeOPUSWithPressAndHold   
)

◆ TEST_F() [74/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeOPUSWithWakeWord   
)

This function verifies that AudioInputProcessor::recognize() works with OPUS encoding used with Initiator::WAKEWORD valid begin and end indices.

◆ TEST_F() [75/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordWithKWDMetadata   
)

This function verifies that AudioInputProcessor::recognize() creates a MessageRequest with KWDMetadata When metadata has been received

◆ TEST_F() [76/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeInvalidWakeWord   
)

This function verifies that AudioInputProcessor::recognize() does not generate an event for invalid keyword detections (ex. "STOP")

◆ TEST_F() [77/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamSuccessBeforeClose   
)

This function verifies that AudioInputProcessor state will continue listening when the recognize event stream has received SUCCESS but not yet closed.

◆ TEST_F() [78/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamSuccess   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has been successfully sent.

◆ TEST_F() [79/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamSuccessNoContentBeforeClose   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has received SUCCESS_NO_CONTENT but the stream has not yet closed.

◆ TEST_F() [80/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamPendingBeforeClose   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has received PENDING but the stream has not yet closed.

◆ TEST_F() [81/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamSuccessNoContent   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has been successfully sent but received no HTTP/2 content.

◆ TEST_F() [82/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamSuccessNotConnected   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has not been sent due to connection to AVS has been severed.

◆ TEST_F() [83/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamNotSynchronized   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has not been sent due to AVS is not synchronized.

◆ TEST_F() [84/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamInternalrror   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has not been sent due to an internal error within ACL.

◆ TEST_F() [85/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamProtocolError   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has not been sent due to an underlying protocol error.

◆ TEST_F() [86/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamServerInternalError   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has not been sent due to an internal error on the server which sends code 500.

◆ TEST_F() [87/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamRefused   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has not been sent due to server refusing the request.

◆ TEST_F() [88/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamCanceled   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has not been sent due to server canceling it before the transmission completed.

◆ TEST_F() [89/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamThrottled   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has not been sent due to excessive load on the server.

◆ TEST_F() [90/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamInvalidAuth   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has not been sent due to the access credentials provided to ACL were invalid.

◆ TEST_F() [91/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamBadRequest   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has not been sent due to invalid request sent by the user.

◆ TEST_F() [92/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamUnknownServerError   
)

This function verifies that AudioInputProcessor state will stop listening when the recognize event stream has not been sent due to unknown server error.

◆ TEST_F() [93/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamSuccess   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has been successfully sent.

◆ TEST_F() [94/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamSuccessNoContent   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has been successfully sent but received no HTTP/2 content.

◆ TEST_F() [95/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamSuccessNotConnected   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has not been sent due to connection to AVS has been severed.

◆ TEST_F() [96/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamNotSynchronized   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has not been sent due to AVS is not synchronized.

◆ TEST_F() [97/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamInternalrror   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has not been sent due to an internal error within ACL.

◆ TEST_F() [98/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamProtocolError   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has not been sent due to an underlying protocol error.

◆ TEST_F() [99/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamServerInternalError   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has not been sent due to an internal error on the server which sends code 500.

◆ TEST_F() [100/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamRefused   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has not been sent due to server refusing the request.

◆ TEST_F() [101/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamCanceled   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has not been sent due to server canceling it before the transmission completed.

◆ TEST_F() [102/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamThrottled   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has not been sent due to excessive load on the server.

◆ TEST_F() [103/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamInvalidAuth   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has not been sent due to the access credentials provided to ACL were invalid.

◆ TEST_F() [104/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamBadRequest   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has not been sent due to invalid request sent by the user.

◆ TEST_F() [105/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnDirectiveAndStreamUnknownServerError   
)

This function verifies that AudioInputProcessor state is correct after receiving a stop capture directive and the recognize event stream has not been sent due to unknown server error.

◆ TEST_F() [106/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamSuccessAndDirectiveBeforeClose   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has received SUCCESS but is not yet closed and a stop capture directive has been received.

◆ TEST_F() [107/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamSuccessAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has been successfully sent and a stop capture directive is received. Also make sure setCompleted() is called on the directive.

◆ TEST_F() [108/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamSuccessNoContentAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has been successfully sent but received no HTTP/2 content and a stop capture directive is received.

◆ TEST_F() [109/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamSuccessNotConnectedAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has not been sent due to connection to AVS has been severed and a stop capture directive is received.

◆ TEST_F() [110/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamNotSynchronizedAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has not been sent due to AVS is not synchronized and a stop capture directive is received.

◆ TEST_F() [111/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamInternalrrorAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has not been sent due to an internal error within ACL and a stop capture directive is received.

◆ TEST_F() [112/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamProtocolErrorAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has not been sent due to an underlying protocol error and a stop capture directive is received.

◆ TEST_F() [113/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamServerInternalErrorAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has not been sent due to an internal error on the server which sends code 500 and a stop capture directive is received.

◆ TEST_F() [114/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamRefusedAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has not been sent due to server refusing the request and a stop capture directive is received.

◆ TEST_F() [115/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamCanceledAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has not been sent due to server canceling it before the transmission completed and a stop capture directive is received.

◆ TEST_F() [116/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamThrottledAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has not been sent due to excessive load on the server and a stop capture directive is received.

◆ TEST_F() [117/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamInvalidAuthAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has not been sent due to the access credentials provided to ACL were invalid and a stop capture directive is received.

◆ TEST_F() [118/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamBadRequestAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has not been sent due to invalid request sent by the user and a stop capture directive is received.

◆ TEST_F() [119/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureOnStreamUnknownServerErrorAndDirective   
)

This function verifies that AudioInputProcessor state is correct after the recognize event stream has not been sent due to unknown server error and a stop capture directive is received.

◆ TEST_F() [120/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_handleSetEndOfSpeechOffsetSuccess   
)

◆ TEST_F() [121/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_handleSetEndOfSpeechOffsetFailureInvalid   
)

This function verifies that the SET_END_OF_SPEECH_OFFSET directive gracefully handles invalid offset values

◆ TEST_F() [122/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_handleSetEndOfSpeechOffsetFailureMissing   
)

This function verifies that the SET_END_OF_SPEECH_OFFSET directive gracefully handles missing offset values

◆ TEST_F() [123/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_handleSetWakeWordConfirmation   
)

This function verifies that the SetWakeWordConfirmation directive can be handled successfully.

◆ TEST_F() [124/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_setSpeechConfirmation   
)

This function verifies that the SetSpeechConfirmation directive can be handled successfully.

◆ TEST_F() [125/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_setWakeWordsDirectiveSuccess   
)

Test if SetWakeWords directive is handled correctly.

◆ TEST_F() [126/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_publishedCapabiltiesContainsSupportedWakeWords   
)

◆ TEST_F() [127/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_localeAssetsChanged   
)

Test if the AudioInputProcessor notifies observers when locale asset is changed and updates its own capability configurations.

◆ TEST_F() [128/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_requestEncodingAudioFormatsSuccess   
)

Test if request for multiple encoding formats can be handled correctly.

◆ TEST_F() [129/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_requestEncodingAudioFormatsWithFallbackAndUnsupportedFormats   
)

Test if request for unsupported encoding formats can be handled correctly.

◆ TEST_F() [130/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_requestEncodingAudioFormatsFails   
)

This function verifies that when no provided encoding formats are supported, the current encoding formats won't be changed.

◆ TEST_F() [131/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordWithKeywordForMultiStreams   
)

This function verifies that AudioInputProcessor::recognize() works with Initiator::WAKEWORD and keyword for multiple audio streams

◆ TEST_F() [132/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordWithMetadataForMultipleAudioStreams   
)

This function verifies that recognize() works with KWD metadata for multiple audio streams.

◆ TEST_F() [133/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordStopAfterSendForMultiStreams   
)

This function verifies that recognize() works for multiple audio streams when stopCapture is called after message is sent

◆ TEST_F() [134/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordStopAfterRecognizeForMultiStreams   
)

This function verifies that recognize() works for multiple audio streams when stopCapture is called immediately after recognize() is called.

◆ TEST_F() [135/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordStopAfterContextForMultiStreams   
)

This function verifies that recognize() works for multiple audio streams when stopCapture is called immediately after onContextAvailable() called.

◆ TEST_F() [136/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordStopCaptureAfterFocusForMultiStreams   
)

This function verifies that recognize() works for multiple audio streams when stopCapture() is called after onFocusChanged() called.

◆ TEST_F() [137/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWakewordWithGoodBeginAndEndForMultiStreams   
)

This function verifies that recognize() works for multiple streams when valid begin and end indices are provided.

◆ TEST_F() [138/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeBargeInWhileRecognizingCloseTalkForMultiStreams   
)

This function verifies that recognize() works for multiple audio streams in State::RECOGNIZING when the previous * recognize used the CLOSE_TALK profile. Disabled for potential race condition in audio encoder.

◆ TEST_F() [139/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_stopCaptureWhenRecognizingForMultiStreams   
)

This function verifies that AudioInputProcessor::stopCapture() works in State::RECOGNIZING with multiple audio streams.

◆ TEST_F() [140/140]

alexaClientSDK::capabilityAgents::aip::test::TEST_F ( AudioInputProcessorTest  ,
test_recognizeWorksWithOneFormatInRequestEncodingAudioFormats   
)

This function verifies that after call requestEncodingAudioFormats with only one format in the request, AIP will still send resolved MessageRequest.

◆ TEST_TIMEOUT()

static const std::chrono::seconds alexaClientSDK::capabilityAgents::aip::test::TEST_TIMEOUT ( 10  )
static

General timeout for tests to fail.

Variable Documentation

◆ ALWAYS_READABLE

const bool alexaClientSDK::capabilityAgents::aip::test::ALWAYS_READABLE = true
static

Boolean value to indicate an AudioProvider is always readable.

◆ ASR_PROFILE_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::ASR_PROFILE_KEY = "profile"
static

JSON key for the ASR profile field of a recognize event.

◆ AUDIO_ATTACHMENT_FIELD_NAME

const std::string alexaClientSDK::capabilityAgents::aip::test::AUDIO_ATTACHMENT_FIELD_NAME = "audio"
static

The field name for the user voice attachment.

◆ AUDIO_FORMAT_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::AUDIO_FORMAT_KEY = "format"
static

JSON key for the audio format field of a recognize event.

◆ AUDIO_FORMAT_LPCM

const std::string alexaClientSDK::capabilityAgents::aip::test::AUDIO_FORMAT_LPCM = "AUDIO_L16_RATE_16000_CHANNELS_1"
static

JSON value for audio format LPCM.

◆ AUDIO_FORMAT_OPUS

const std::string alexaClientSDK::capabilityAgents::aip::test::AUDIO_FORMAT_OPUS = "OPUS"
static

JSON value for audio format OPUS.

◆ AUDIO_FORMAT_VALUES

const std::unordered_set<std::string> alexaClientSDK::capabilityAgents::aip::test::AUDIO_FORMAT_VALUES = {AUDIO_FORMAT_LPCM, AUDIO_FORMAT_OPUS}
static

Accepted JSON values for a recognize event's audio format.

◆ CAN_BE_OVERRIDDEN

const bool alexaClientSDK::capabilityAgents::aip::test::CAN_BE_OVERRIDDEN = true
static

Boolean value to indicate an AudioProvider can be overridden by another AudioProvider.

◆ CAN_OVERRIDE

const bool alexaClientSDK::capabilityAgents::aip::test::CAN_OVERRIDE = true
static

Boolean value to indicate an AudioProvider can override another AudioProvider.

◆ CAPABILITY_INTERFACE_CONFIGURATIONS_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::CAPABILITY_INTERFACE_CONFIGURATIONS_KEY = "configurations"
static

Capability configuration key used to give more details about the device configuration.

◆ CHANNEL_NAME

const std::string alexaClientSDK::capabilityAgents::aip::test::CHANNEL_NAME = avsCommon::sdkInterfaces::FocusManagerInterface::DIALOG_CHANNEL_NAME
static

The name of the FocusManager channel used by AudioInputProvider.

◆ CONTEXT_REQUEST_TOKEN

const ContextRequestToken alexaClientSDK::capabilityAgents::aip::test::CONTEXT_REQUEST_TOKEN {1}
static

◆ DEFAULT_LOCALE

const std::string alexaClientSDK::capabilityAgents::aip::test::DEFAULT_LOCALE = "en-CA"
static

Default locale.

◆ DIRECTIVES

const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::test::DIRECTIVES[]
static
Initial value:
static const avsCommon::avs::NamespaceAndName SET_WAKE_WORDS
The SetWakeWords directive signature.
Definition: AudioInputProcessorTest.cpp:103
static const avsCommon::avs::NamespaceAndName SET_WAKE_WORD_CONFIRMATION
The SetWakeWordConfirmation directive signature.
Definition: AudioInputProcessorTest.cpp:97
static const avsCommon::avs::NamespaceAndName SET_SPEECH_CONFIRMATION
The SetSpeechConfirmation directive signature.
Definition: AudioInputProcessorTest.cpp:100
static const avsCommon::avs::NamespaceAndName SET_END_OF_SPEECH_OFFSET
The SetEndOfSpeechOffset directive signature.
Definition: AudioInputProcessorTest.cpp:94
static const avsCommon::avs::NamespaceAndName STOP_CAPTURE
The StopCapture directive signature.
Definition: AudioInputProcessorTest.cpp:88
static const avsCommon::avs::NamespaceAndName EXPECT_SPEECH
The ExpectSpeech directive signature.
Definition: AudioInputProcessorTest.cpp:91

The directives AudioInputProcessor should handle.

◆ ENCODING_FORMAT_REQ

const AudioInputProcessor::EncodingFormatRequest alexaClientSDK::capabilityAgents::aip::test::ENCODING_FORMAT_REQ
static
Initial value:
= {
{"CLOUD", {avsCommon::utils::AudioFormat::Encoding::OPUS, avsCommon::utils::AudioFormat::Encoding::LPCM}},
{"LOCAL", {avsCommon::utils::AudioFormat::Encoding::LPCM, avsCommon::utils::AudioFormat::Encoding::LPCM}},
{"LOCAL2", {avsCommon::utils::AudioFormat::Encoding::LPCM, avsCommon::utils::AudioFormat::Encoding::LPCM}}}

Request to configure AIP to produce multiple audio streams with different encoding formats.

◆ ENCODING_FORMAT_RSP

const AudioInputProcessor::EncodingFormatResponse alexaClientSDK::capabilityAgents::aip::test::ENCODING_FORMAT_RSP
static
Initial value:
= {
{"CLOUD", avsCommon::utils::AudioFormat::Encoding::OPUS},
{"LOCAL", avsCommon::utils::AudioFormat::Encoding::LPCM},
{"LOCAL2", avsCommon::utils::AudioFormat::Encoding::LPCM}}

Response for the request to AIP to produce multiple audio streams.

◆ END_INDEX_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::END_INDEX_KEY = "endIndexInSamples"
static

JSON key for the end index field of a wakeword recognize event's payload.

◆ END_OF_SPEECH_OFFSET_FIELD_NAME

const std::string alexaClientSDK::capabilityAgents::aip::test::END_OF_SPEECH_OFFSET_FIELD_NAME = "endOfSpeechOffsetInMilliseconds"
static

The field name for the end of speech offset, reported in milliseconds. This field comes in the payload of the SetEndOfSpeechOffset directive.

◆ END_OF_SPEECH_OFFSET_IN_MILLISECONDS

const int64_t alexaClientSDK::capabilityAgents::aip::test::END_OF_SPEECH_OFFSET_IN_MILLISECONDS = 1526
static

Value used in the tests for an end of speech offset.

◆ ESP_AMBIENT_ENERGY_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::ESP_AMBIENT_ENERGY_KEY = "ambientEnergy"
static

JSON key for the ambient energy field of a ReportEchoSpatialPerceptionData event.

◆ ESP_EVENT_NAME

const std::string alexaClientSDK::capabilityAgents::aip::test::ESP_EVENT_NAME = "ReportEchoSpatialPerceptionData"
static

JSON value for a ReportEchoSpatialPerceptionData event's name.

◆ ESP_VOICE_ENERGY_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::ESP_VOICE_ENERGY_KEY = "voiceEnergy"
static

JSON key for the voice energy field of a ReportEchoSpatialPerceptionData event.

◆ EXPECT_SPEECH

const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::test::EXPECT_SPEECH {NAMESPACE, "ExpectSpeech"}
static

The ExpectSpeech directive signature.

◆ EXPECT_SPEECH_INITIATOR

const std::string alexaClientSDK::capabilityAgents::aip::test::EXPECT_SPEECH_INITIATOR = R"({"opaque":"expectSpeechInitiator"})"
static

Value used in the tests for an expect speech initiator.

◆ EXPECT_SPEECH_INITIATOR_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::EXPECT_SPEECH_INITIATOR_KEY = "initiator"
static

JSON key for the initiator field of an expect speech directive.

◆ EXPECT_SPEECH_TIMED_OUT_EVENT_NAME

const std::string alexaClientSDK::capabilityAgents::aip::test::EXPECT_SPEECH_TIMED_OUT_EVENT_NAME = "ExpectSpeechTimedOut"
static

JSON value for a expect speech timed out event's name.

◆ EXPECT_SPEECH_TIMEOUT_IN_MILLISECONDS

const int64_t alexaClientSDK::capabilityAgents::aip::test::EXPECT_SPEECH_TIMEOUT_IN_MILLISECONDS = 100
static

Value used in the tests for an expect speech timeout.

◆ EXPECT_SPEECH_TIMEOUT_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::EXPECT_SPEECH_TIMEOUT_KEY = "timeoutInMilliseconds"
static

JSON key for the timeout field of an expect speech directive.

◆ EXPECTED_ENCODING_FORMATS

const std::map<std::string, std::string> alexaClientSDK::capabilityAgents::aip::test::EXPECTED_ENCODING_FORMATS
static
Initial value:
= {{"CLOUD", AUDIO_FORMAT_OPUS},
{"LOCAL", AUDIO_FORMAT_LPCM},
{"LOCAL2", AUDIO_FORMAT_LPCM}}
static const std::string AUDIO_FORMAT_LPCM
JSON value for audio format LPCM.
Definition: AudioInputProcessorTest.cpp:201
static const std::string AUDIO_FORMAT_OPUS
JSON value for audio format OPUS.
Definition: AudioInputProcessorTest.cpp:198

Expected resolve key to encoding format strings.

◆ INITIATOR_PAYLOAD_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::INITIATOR_PAYLOAD_KEY = "payload"
static

JSON key for the type field of a recognize event's payload.

◆ INITIATOR_TYPE_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::INITIATOR_TYPE_KEY = "type"
static

JSON key for the type field of a recognize event's initiator.

◆ KEYWORD_TEXT

const std::string alexaClientSDK::capabilityAgents::aip::test::KEYWORD_TEXT = "ALEXA"
static

Value used in the tests for a wakeword recognize event.

◆ KWD_METADATA_EXAMPLE

const std::string alexaClientSDK::capabilityAgents::aip::test::KWD_METADATA_EXAMPLE = "Wakeword engine metadata example"
static

Sample Wakeword engine metadata to compare with the @ AttachmentReader.

◆ KWD_METADATA_FIELD_NAME

const std::string alexaClientSDK::capabilityAgents::aip::test::KWD_METADATA_FIELD_NAME = "wakewordEngineMetadata"
static

The field name for the wake word engine metadata.

◆ MESSAGE_ATTACHMENT_KWD_METADATA_INDEX

const size_t alexaClientSDK::capabilityAgents::aip::test::MESSAGE_ATTACHMENT_KWD_METADATA_INDEX = 0
static

The index of the Wakeword engine metadata in the MessageRequest.

◆ MESSAGE_CONTEXT_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::MESSAGE_CONTEXT_KEY = "context"
static

JSON key for the context section of a message.

◆ MESSAGE_DIALOG_REQUEST_ID_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::MESSAGE_DIALOG_REQUEST_ID_KEY = "dialogRequestId"
static

JSON key for the dialog request ID field of a message header.

◆ MESSAGE_DIRECTIVE_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::MESSAGE_DIRECTIVE_KEY = "directive"
static

JSON key for the directive section of a message.

◆ MESSAGE_EVENT_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::MESSAGE_EVENT_KEY = "event"
static

JSON key for the event section of a message.

◆ MESSAGE_HEADER_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::MESSAGE_HEADER_KEY = "header"
static

JSON key for the header section of a message.

◆ MESSAGE_MESSAGE_ID_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::MESSAGE_MESSAGE_ID_KEY = "messageId"
static

JSON key for the message ID field of a message header.

◆ MESSAGE_NAME_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::MESSAGE_NAME_KEY = "name"
static

JSON key for the name field of a message header.

◆ MESSAGE_NAMESPACE_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::MESSAGE_NAMESPACE_KEY = "namespace"
static

JSON key for the namespace field of a message header.

◆ MESSAGE_PAYLOAD_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::MESSAGE_PAYLOAD_KEY = "payload"
static

JSON key for the payload section of an message.

◆ NAMESPACE

const std::string alexaClientSDK::capabilityAgents::aip::test::NAMESPACE = "SpeechRecognizer"
static

The namespace for this capability agent.

◆ NUM_CHANNELS

const unsigned int alexaClientSDK::capabilityAgents::aip::test::NUM_CHANNELS = 1
static

Number of channels in audio input stream.

◆ PATTERN_WORDS

const size_t alexaClientSDK::capabilityAgents::aip::test::PATTERN_WORDS = SDS_WORDS / 2
static

Number of test pattern words to write to the SDS circular buffer.

◆ PREROLL_MS

const std::chrono::milliseconds alexaClientSDK::capabilityAgents::aip::test::PREROLL_MS = std::chrono::milliseconds(500)
static

Number of milliseconds of preroll applied for cloud-based wakeword verification.

◆ PREROLL_WORDS

const size_t alexaClientSDK::capabilityAgents::aip::test::PREROLL_WORDS = (SAMPLE_RATE_HZ / 1000) * PREROLL_MS.count()
static

Number of words of preroll.

◆ RECOGNIZE_EVENT_NAME

const std::string alexaClientSDK::capabilityAgents::aip::test::RECOGNIZE_EVENT_NAME = "Recognize"
static

JSON value for a recognize event's name.

◆ RECOGNIZE_INITIATOR_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::RECOGNIZE_INITIATOR_KEY = "initiator"
static

JSON key for the initiator field of a recognize event.

◆ RECOGNIZER_STATE

const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::test::RECOGNIZER_STATE {NAMESPACE, "RecognizerState"}
static

The SpeechRecognizer context state signature.

◆ SAMPLE_RATE_HZ

const unsigned int alexaClientSDK::capabilityAgents::aip::test::SAMPLE_RATE_HZ = 16000
static

Sample rate for audio input stream.

◆ SAMPLE_SIZE_IN_BITS

const unsigned int alexaClientSDK::capabilityAgents::aip::test::SAMPLE_SIZE_IN_BITS = SDS_WORDSIZE * CHAR_BIT
static

Sample size for audio input stream.

◆ SDS_MAXREADERS

const size_t alexaClientSDK::capabilityAgents::aip::test::SDS_MAXREADERS = 10
static

Maximum number of readers to support in the SDS circular buffer.

◆ SDS_WORDS

const size_t alexaClientSDK::capabilityAgents::aip::test::SDS_WORDS = PREROLL_WORDS + WAKEWORD_WORDS + 1000
static

Number of words to hold in the SDS circular buffer.

◆ SDS_WORDSIZE

const size_t alexaClientSDK::capabilityAgents::aip::test::SDS_WORDSIZE = sizeof(Sample)
static

Number of bytes per word in the SDS circular buffer.

◆ SET_END_OF_SPEECH_OFFSET

const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::test::SET_END_OF_SPEECH_OFFSET {NAMESPACE, "SetEndOfSpeechOffset"}
static

The SetEndOfSpeechOffset directive signature.

◆ SET_SPEECH_CONFIRMATION

const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::test::SET_SPEECH_CONFIRMATION {NAMESPACE, "SetSpeechConfirmation"}
static

The SetSpeechConfirmation directive signature.

◆ SET_WAKE_WORD_CONFIRMATION

const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::test::SET_WAKE_WORD_CONFIRMATION {NAMESPACE, "SetWakeWordConfirmation"}
static

The SetWakeWordConfirmation directive signature.

◆ SET_WAKE_WORDS

const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::test::SET_WAKE_WORDS {NAMESPACE, "SetWakeWords"}
static

The SetWakeWords directive signature.

◆ SPEECH_CONFIRMATION_PAYLOAD_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::SPEECH_CONFIRMATION_PAYLOAD_KEY = "speechConfirmation"
static

The value of the payload key for speechConfirmation.

◆ START_INDEX_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::START_INDEX_KEY = "startIndexInSamples"
static

JSON key for the start index field of a wakeword recognize event's payload.

◆ START_OF_SPEECH_TIMESTAMP

const auto alexaClientSDK::capabilityAgents::aip::test::START_OF_SPEECH_TIMESTAMP = std::chrono::steady_clock::now()
static

Value used in the tests for an start of speech timestamp.

◆ START_OF_SPEECH_TIMESTAMP_FIELD_NAME

const std::string alexaClientSDK::capabilityAgents::aip::test::START_OF_SPEECH_TIMESTAMP_FIELD_NAME = "startOfSpeechTimestamp"
static

The field name for the start of speech timestamp. It is sent during Recognize event and received as part of SetEndOfSpeechOffset directive.

◆ START_OF_SPEECH_TIMESTAMP_STR

const auto alexaClientSDK::capabilityAgents::aip::test::START_OF_SPEECH_TIMESTAMP_STR = std::to_string(START_OF_SPEECH_TIMESTAMP.time_since_epoch().count())
static

String value used for start of speech timestamp string representation.

◆ STOP_CAPTURE

const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::test::STOP_CAPTURE {NAMESPACE, "StopCapture"}
static

The StopCapture directive signature.

◆ SUPPORTED_LOCALE_SPECIFIC_WAKEWORDS

const std::map<std::string, std::set<std::set<std::string> > > alexaClientSDK::capabilityAgents::aip::test::SUPPORTED_LOCALE_SPECIFIC_WAKEWORDS
static
Initial value:
= {
{"en-US", {{"COMPUTER"}}}}

A list of test supported locale specific wakewords.

◆ SUPPORTED_LOCALES

const std::set<std::string> alexaClientSDK::capabilityAgents::aip::test::SUPPORTED_LOCALES = {"en-CA", "en-US"}
static

A list of test supported locales.

◆ SUPPORTED_WAKE_WORDS

const std::set<std::string> alexaClientSDK::capabilityAgents::aip::test::SUPPORTED_WAKE_WORDS = {"ALEXA", "ECHO"}
static

A list of test supported wake words.

◆ VERIFY_TIMEOUT

const bool alexaClientSDK::capabilityAgents::aip::test::VERIFY_TIMEOUT = true
static

Boolean value to indicate an expect speech directive should time out.

◆ WAKE_WORD_CONFIRMATION_PAYLOAD_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::WAKE_WORD_CONFIRMATION_PAYLOAD_KEY = "wakeWordConfirmation"
static

The value of the payload key for wakeWordConfirmation.

◆ WAKE_WORD_INDICES_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::WAKE_WORD_INDICES_KEY = "wakeWordIndices"
static

JSON key for the wakeword indices field of a wakeword recognize event's payload.

◆ WAKEWORD_FIELD_NAME

const std::string alexaClientSDK::capabilityAgents::aip::test::WAKEWORD_FIELD_NAME = "wakeWord"
static

The field name for the wake word detected.

◆ WAKEWORD_WORDS

const size_t alexaClientSDK::capabilityAgents::aip::test::WAKEWORD_WORDS = PREROLL_WORDS
static

Number of words in wakeword.

◆ WAKEWORDS_PAYLOAD_KEY

const std::string alexaClientSDK::capabilityAgents::aip::test::WAKEWORDS_PAYLOAD_KEY = "wakeWords"
static

The value of the payload key for wake words.

◆ WITH_DIALOG_REQUEST_ID

const bool alexaClientSDK::capabilityAgents::aip::test::WITH_DIALOG_REQUEST_ID = true
static

Boolean value to indicate a directive being tested has a dialog request ID.

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