AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Macros | Functions | Variables
AudioInputProcessorIntegrationTest.cpp File Reference
#include <chrono>
#include <deque>
#include <fstream>
#include <future>
#include <mutex>
#include <string>
#include <unordered_map>
#include <gtest/gtest.h>
#include <ACL/AVSConnectionManager.h>
#include <acsdkManufactory/Annotated.h>
#include <ADSL/DirectiveSequencer.h>
#include <ADSL/MessageInterpreter.h>
#include <AFML/Channel.h>
#include <AFML/FocusManager.h>
#include <AIP/AudioInputProcessor.h>
#include <AIP/AudioProvider.h>
#include <AIP/Initiator.h>
#include <Audio/SystemSoundAudioFactory.h>
#include <AVSCommon/AVS/Attachment/InProcessAttachmentWriter.h>
#include <AVSCommon/AVS/BlockingPolicy.h>
#include <AVSCommon/AVS/CapabilityChangeNotifier.h>
#include <AVSCommon/SDKInterfaces/ChannelObserverInterface.h>
#include <AVSCommon/SDKInterfaces/DirectiveHandlerInterface.h>
#include <AVSCommon/SDKInterfaces/KeyWordObserverInterface.h>
#include <AVSCommon/SDKInterfaces/MockLocaleAssetsManager.h>
#include <AVSCommon/SDKInterfaces/Endpoints/MockEndpointCapabilitiesRegistrar.h>
#include <AVSCommon/Utils/JSON/JSONUtils.h>
#include <AVSCommon/Utils/LibcurlUtils/HTTPContentFetcherFactory.h>
#include <AVSCommon/Utils/Logger/LogEntry.h>
#include <AVSCommon/Utils/Metrics/MockMetricRecorder.h>
#include <AVSCommon/Utils/Threading/Executor.h>
#include "Integration/TestMediaPlayer.h"
#include <acsdkInteractionModel/InteractionModelCapabilityAgent.h>
#include <acsdkInteractionModel/InteractionModelNotifier.h>
#include <Settings/MockSetting.h>
#include <Settings/SpeechConfirmationSettingType.h>
#include <Settings/WakeWordConfirmationSettingType.h>
#include <SystemSoundPlayer/SystemSoundPlayer.h>
#include "Integration/ACLTestContext.h"
#include "Integration/ObservableMessageRequest.h"
#include "Integration/AipStateObserver.h"
#include "Integration/TestMessageSender.h"
#include "Integration/TestDirectiveHandler.h"
#include "Integration/TestExceptionEncounteredSender.h"
#include "System/UserInactivityMonitor.h"
Include dependency graph for AudioInputProcessorIntegrationTest.cpp:

Classes

class  alexaClientSDK::integration::test::tapToTalkButton
 
class  alexaClientSDK::integration::test::holdToTalkButton
 
class  alexaClientSDK::integration::test::testStateProvider
 
class  alexaClientSDK::integration::test::TestClient
 A test observer that mocks out the ChannelObserverInterface#onFocusChanged() call. More...
 
class  alexaClientSDK::integration::test::AudioInputProcessorTest
 

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::integration
 
 alexaClientSDK::integration::test
 

Macros

#define LX(event)   ::alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)
 

Functions

static const std::chrono::seconds alexaClientSDK::integration::test::LONG_TIMEOUT_DURATION (10)
 
static const std::chrono::seconds alexaClientSDK::integration::test::SHORT_TIMEOUT_DURATION (2)
 
static const std::chrono::seconds alexaClientSDK::integration::test::NO_TIMEOUT_DURATION (0)
 
static const std::string alexaClientSDK::integration::test::TAG ("AlexaDirectiveSequencerLibraryTest")
 String to identify log entries originating from this file. More...
 
template<typename T >
std::vector< T > alexaClientSDK::integration::test::readAudioFromFile (const std::string &fileName, const int &headerPosition, bool *errorOccurred)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, DISABLED_test_tapToTalkJoke)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, DISABLED_test_tapToTalkTimeOpus)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, DISABLED_test_tapToTalkSilence)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, test_tapToTalkNoAudio)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, test_tapToTalkMultiturn)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, DISABLED_test_tapToTalkMultiturnWithoutUserResponse)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, test_tapToTalkCancel)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, test_holdToTalkJoke)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, DISABLED_test_holdToTalkMultiturn)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, DISABLED_test_holdToTalkMultiTurnWithSilence)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, DISABLED_test_holdToTalkMultiturnWithTimeOut)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, test_holdToTalkNoAudio)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, test_holdToTalkCancel)
 
 alexaClientSDK::integration::test::TEST_F (AudioInputProcessorTest, test_audioWithoutAnyTrigger)
 
int main (int argc, char **argv)
 

Variables

static const std::string alexaClientSDK::integration::test::JOKE_AUDIO_FILE = "/recognize_joke_test.wav"
 
static const std::string alexaClientSDK::integration::test::WIKI_AUDIO_FILE = "/recognize_wiki_test.wav"
 
static const std::string alexaClientSDK::integration::test::LIONS_AUDIO_FILE = "/recognize_lions_test.wav"
 
static const std::string alexaClientSDK::integration::test::SILENCE_AUDIO_FILE = "/recognize_silence_test.wav"
 
static const std::string alexaClientSDK::integration::test::ALEXA_JOKE_AUDIO_FILE = "/alexa_recognize_joke_test.wav"
 
static const std::string alexaClientSDK::integration::test::ALEXA_WIKI_AUDIO_FILE = "/alexa_recognize_wiki_test.wav"
 
static const std::string alexaClientSDK::integration::test::ALEXA_SILENCE_AUDIO_FILE = "/alexa_recognize_silence_test.wav"
 
static const std::string alexaClientSDK::integration::test::TIME_AUDIO_FILE_OPUS = "/utterance_time_success.opus"
 
static const std::string alexaClientSDK::integration::test::NAME_VOLUME_STATE = "VolumeState"
 
static const std::string alexaClientSDK::integration::test::NAME_SPEAK = "Speak"
 
static const std::string alexaClientSDK::integration::test::NAME_EXPECT_SPEECH = "ExpectSpeech"
 
static const std::string alexaClientSDK::integration::test::NAME_EXPECT_SPEECH_TIMED_OUT = "ExpectSpeechTimedOut"
 
static const std::string alexaClientSDK::integration::test::NAME_SET_MUTE = "SetMute"
 
static const std::string alexaClientSDK::integration::test::NAME_PLAY = "Play"
 
static const std::string alexaClientSDK::integration::test::NAME_STOP_CAPTURE = "StopCapture"
 
static const std::string alexaClientSDK::integration::test::NAME_RECOGNIZE = "Recognize"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_SPEECH_RECOGNIZER = "SpeechRecognizer"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_SPEECH_SYNTHESIZER = "SpeechSynthesizer"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_AUDIO_PLAYER = "AudioPlayer"
 
static const std::string alexaClientSDK::integration::test::NAMESPACE_SPEAKER = "Speaker"
 
static const NamespaceAndName alexaClientSDK::integration::test::SPEAK_PAIR = {NAMESPACE_SPEECH_SYNTHESIZER, NAME_SPEAK}
 
static const NamespaceAndName alexaClientSDK::integration::test::EXPECT_SPEECH_PAIR = {NAMESPACE_SPEECH_RECOGNIZER, NAME_EXPECT_SPEECH}
 
static const NamespaceAndName alexaClientSDK::integration::test::SET_MUTE_PAIR = {NAMESPACE_SPEAKER, NAME_SET_MUTE}
 
static const NamespaceAndName alexaClientSDK::integration::test::VOLUME_STATE_PAIR = {NAMESPACE_SPEAKER, NAME_VOLUME_STATE}
 
static const NamespaceAndName alexaClientSDK::integration::test::PLAY_PAIR = {NAMESPACE_AUDIO_PLAYER, NAME_PLAY}
 
static const NamespaceAndName alexaClientSDK::integration::test::STOP_CAPTURE_PAIR = {NAMESPACE_SPEECH_RECOGNIZER, NAME_STOP_CAPTURE}
 
static const std::string alexaClientSDK::integration::test::DIALOG_ACTIVITY_ID = "Dialog"
 Sample dialog activity id. More...
 
static const std::string alexaClientSDK::integration::test::ALARM_ACTIVITY_ID = "Alarms"
 Sample alerts activity id. More...
 
static const std::string alexaClientSDK::integration::test::CONTENT_ACTIVITY_ID = "Content"
 Sample content activity id. More...
 
static const int alexaClientSDK::integration::test::RIFF_HEADER_SIZE = 44
 
static const unsigned int alexaClientSDK::integration::test::COMPATIBLE_SAMPLE_RATE_OPUS_32 = 32000
 The compatible sample rate for OPUS 32KHz. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_DIRECTIVE_KEY = "directive"
 JSON key to get the directive object of a message. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_HEADER_KEY = "header"
 JSON key to get the header object of a message. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_NAMESPACE_KEY = "namespace"
 JSON key to get the namespace value of a header. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_NAME_KEY = "name"
 JSON key to get the name value of a header. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_MESSAGE_ID_KEY = "messageId"
 JSON key to get the messageId value of a header. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_DIALOG_REQUEST_ID_KEY = "dialogRequestId"
 JSON key to get the dialogRequestId value of a header. More...
 
static const std::string alexaClientSDK::integration::test::JSON_MESSAGE_PAYLOAD_KEY = "payload"
 JSON key to get the payload object of a message. More...
 
static const avsCommon::utils::AudioFormat::Encoding alexaClientSDK::integration::test::COMPATIBLE_ENCODING
 The compatible encoding. More...
 
static const avsCommon::utils::AudioFormat::Endianness alexaClientSDK::integration::test::COMPATIBLE_ENDIANNESS
 The compatible endianness. More...
 
static const unsigned int alexaClientSDK::integration::test::COMPATIBLE_SAMPLE_RATE = 16000
 The compatible sample rate. More...
 
static const unsigned int alexaClientSDK::integration::test::COMPATIBLE_SAMPLE_SIZE_IN_BITS = 16
 The compatible bits per sample. More...
 
static const unsigned int alexaClientSDK::integration::test::COMPATIBLE_NUM_CHANNELS = 1
 The compatible number of channels. More...
 
static std::string alexaClientSDK::integration::test::g_configPath
 Path to the AlexaClientSDKConfig.json file (from command line arguments). More...
 
static std::string alexaClientSDK::integration::test::g_inputPath
 Path to resources (e.g. audio files) for tests (from command line arguments). More...
 

Macro Definition Documentation

◆ LX

#define LX (   event)    ::alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)

Create a LogEntry using this file's TAG and the specified event string.

Parameters
Theevent string for this LogEntry.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

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