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

Classes

class  MockSpeechSynthesizerObserver
 
struct  SpeakTestInfo
 
class  SpeechSynthesizerTest
 

Typedefs

using MediaPlayerState = avsCommon::utils::mediaPlayer::MediaPlayerState
 
using PowerResourceLevel = PowerResourceManagerInterface::PowerResourceLevel
 

Functions

static const std::chrono::milliseconds MY_WAIT_TIMEOUT (1000)
 Plenty of time for a test to complete. More...
 
static const std::chrono::milliseconds STATE_CHANGE_TIMEOUT (10000)
 
static const std::string CHANNEL_NAME (avsCommon::sdkInterfaces::FocusManagerInterface::DIALOG_CHANNEL_NAME)
 The name of the FocusManager channel used by the SpeechSynthesizer. More...
 
static const std::string NAMESPACE_SPEECH_SYNTHESIZER ("SpeechSynthesizer")
 Namespace for SpeechSynthesizer. More...
 
static const std::string NAME_SPEAK ("Speak")
 Name for SpeechSynthesizer directive. More...
 
static const std::string NAME_RECOGNIZE ("Recognize")
 Wrong name for testing. More...
 
static const std::string MESSAGE_ID_TEST ("MessageId_Test")
 Message Id for testing. More...
 
static const std::string MESSAGE_ID_TEST_2 ("MessageId_Test_2")
 Message Id for testing. More...
 
static const std::string DIALOG_REQUEST_ID_TEST ("DialogRequestId_Test")
 DialogRequestId for testing. More...
 
static const std::string TOKEN_TEST ("Token_Test")
 Token for testing. More...
 
static const std::string FORMAT_TEST ("AUDIO_MPEG")
 Format of the audio. More...
 
static const std::string URL_TEST ("cid:Test")
 URL for testing. More...
 
static const std::string CONTEXT_ID_TEST ("ContextId_Test")
 Context ID for testing. More...
 
static const std::string CONTEXT_ID_TEST_2 ("ContextId_Test_2")
 Context ID for testing. More...
 
static const std::string FINISHED_STATE ("FINISHED")
 The FINISHED state of the SpeechSynthesizer. More...
 
static const std::string COMPONENT_NAME ("SpeechSynthesizer")
 Component name for power resource management. More...
 
static SpeakTestInfo generateSpeakInfo (PlayBehavior playBehavior)
 
static std::string generatePlayingState (const SpeakTestInfo &info)
 
static std::string generateFinishedState (const SpeakTestInfo &info)
 
static std::string generateInterruptedState (const SpeakTestInfo &info)
 
static bool matchEvent (std::shared_ptr< MessageRequest > request, const std::string &expectedContent)
 
 MATCHER (IsStartedEvent, "")
 
 MATCHER (IsFinishedEvent, "")
 
 MATCHER (IsInterruptedEvent, "")
 
 TEST_F (SpeechSynthesizerTest, test_createWithNullAudioPipelineFactoryFails)
 
 TEST_F (SpeechSynthesizerTest, test_callingHandleImmediately)
 
 TEST_F (SpeechSynthesizerTest, test_callingHandle)
 
 TEST_F (SpeechSynthesizerTest, test_callingCancel)
 
 TEST_F (SpeechSynthesizerTest, test_callingCancelAfterHandle)
 
 TEST_F (SpeechSynthesizerTest, test_callingProvideStateWhenNotPlaying)
 
 TEST_F (SpeechSynthesizerTest, test_callingProvideStateWhenPlaying)
 
 TEST_F (SpeechSynthesizerTest, testTimer_bargeInWhilePlaying)
 
 TEST_F (SpeechSynthesizerTest, testTimer_notCallStopTwice)
 
 TEST_F (SpeechSynthesizerTest, testSlow_callingCancelBeforeOnFocusChanged)
 
 TEST_F (SpeechSynthesizerTest, test_callingCancelBeforeOnExecuteStateChanged)
 
 TEST_F (SpeechSynthesizerTest, test_mediaPlayerFailedToStop)
 
 TEST_F (SpeechSynthesizerTest, testTimer_mediaPlayerAlwaysFailToStop)
 
 TEST_F (SpeechSynthesizerTest, testSlow_setStateTimeout)
 
 TEST_F (SpeechSynthesizerTest, test_givenPlayingStateFocusBecomesNone)
 
 TEST_F (SpeechSynthesizerTest, testTimer_onPlayedStopped)
 
 TEST_F (SpeechSynthesizerTest, test_replaceAllWithEmptyQueue)
 
 TEST_F (SpeechSynthesizerTest, test_replaceAllWithNonEmptyQueue)
 
 TEST_F (SpeechSynthesizerTest, test_replaceAllStopActiveSpeech)
 
 TEST_F (SpeechSynthesizerTest, test_enqueueWithActiveSpeech)
 
 TEST_F (SpeechSynthesizerTest, test_replaceEnqueuedWithAnotherEnqueuedItem)
 
 TEST_F (SpeechSynthesizerTest, test_parsingSingleAnalyzerConfig)
 
 TEST_F (SpeechSynthesizerTest, test_parsingMultipleAnalyzerConfig)
 

Variables

static const MediaPlayerState DEFAULT_MEDIA_PLAYER_STATE = {std::chrono::milliseconds(0)}
 Default media player state for all playback events. More...
 
static std::string SPEECH_STARTED_EVENT_NAME {"SpeechStarted"}
 The name of the event to send to the AVS server once audio starting playing. More...
 
static std::string SPEECH_FINISHED_EVENT_NAME {"SpeechFinished"}
 The name of the event to send to the AVS server once audio finishes playing. More...
 
static std::string SPEECH_INTERRUPTED_EVENT_NAME {"SpeechInterrupted"}
 The name of the event to send to the AVS server once audio playing has been interrupted. More...
 
static const NamespaceAndName NAMESPACE_AND_NAME_SPEECH_STATE {NAMESPACE_SPEECH_SYNTHESIZER, "SpeechState"}
 The NamespaceAndName to send to the ContextManager. More...
 
static const std::string CAPTION_CONTENT_SAMPLE
 
static const std::string PAYLOAD_TEST
 A payload for testing. More...
 
static const std::string PAYLOAD_TEST_SINGLE_ANALYZER
 A payload for testing with single audio analyzer entry. More...
 
static const std::string PAYLOAD_TEST_MULTIPLE_ANALYZER
 A payload for testing with multiple audio analyzer entry. More...
 
static const std::string PLAYING_STATE {"PLAYING"}
 The PLAYING state of the SpeechSynthesizer. More...
 
static const std::string INTERRUPTED_STATE {"INTERRUPTED"}
 The INTERRUPTED state of the SpeechSynthesizer. More...
 
static const long OFFSET_IN_MILLISECONDS_TEST {100}
 The offset in milliseconds returned by the mock media player. More...
 
static const std::chrono::milliseconds OFFSET_IN_CHRONO_MILLISECONDS_TEST {100}
 An std::chrono::milliseconds representation of the offset. More...
 
static const std::string PLAYING_STATE_TEST
 The expected state when the SpeechSynthesizer is in PLAYING state. More...
 
static const std::string FINISHED_STATE_TEST
 The expected state when the SpeechSynthesizer is in FINISHED state. More...
 
static const std::string INTERRUPTED_STATE_TEST
 The expected state when the SpeechSynthesizer is in INTERRUPTED state. More...
 
static const std::string IDLE_STATE_TEST
 The expected state when the SpeechSynthesizer is not handling any directive. More...
 
static const unsigned int PROVIDE_STATE_TOKEN_TEST {1}
 Provide State Token for testing. More...
 

Typedef Documentation

◆ MediaPlayerState

◆ PowerResourceLevel

Function Documentation

◆ CHANNEL_NAME()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::CHANNEL_NAME ( avsCommon::sdkInterfaces::FocusManagerInterface::DIALOG_CHANNEL_NAME  )
static

The name of the FocusManager channel used by the SpeechSynthesizer.

◆ COMPONENT_NAME()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::COMPONENT_NAME ( "SpeechSynthesizer"  )
static

Component name for power resource management.

◆ CONTEXT_ID_TEST()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::CONTEXT_ID_TEST ( "ContextId_Test"  )
static

Context ID for testing.

◆ CONTEXT_ID_TEST_2()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::CONTEXT_ID_TEST_2 ( "ContextId_Test_2"  )
static

Context ID for testing.

◆ DIALOG_REQUEST_ID_TEST()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::DIALOG_REQUEST_ID_TEST ( "DialogRequestId_Test"  )
static

DialogRequestId for testing.

◆ FINISHED_STATE()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::FINISHED_STATE ( "FINISHED"  )
static

The FINISHED state of the SpeechSynthesizer.

◆ FORMAT_TEST()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::FORMAT_TEST ( "AUDIO_MPEG"  )
static

Format of the audio.

◆ generateFinishedState()

static std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::generateFinishedState ( const SpeakTestInfo info)
static

◆ generateInterruptedState()

static std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::generateInterruptedState ( const SpeakTestInfo info)
static

◆ generatePlayingState()

static std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::generatePlayingState ( const SpeakTestInfo info)
static

◆ generateSpeakInfo()

static SpeakTestInfo alexaClientSDK::capabilityAgents::speechSynthesizer::test::generateSpeakInfo ( PlayBehavior  playBehavior)
static

◆ MATCHER() [1/3]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::MATCHER ( IsStartedEvent  ,
""   
)

◆ MATCHER() [2/3]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::MATCHER ( IsFinishedEvent  ,
""   
)

◆ MATCHER() [3/3]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::MATCHER ( IsInterruptedEvent  ,
""   
)

◆ matchEvent()

static bool alexaClientSDK::capabilityAgents::speechSynthesizer::test::matchEvent ( std::shared_ptr< MessageRequest request,
const std::string &  expectedContent 
)
static

Match request by the event content. This does a simple string search.

Parameters
requestThe request to be checked.
expectedContentThe content that should be included in the request.
Returns
If the content was found or not.

◆ MESSAGE_ID_TEST()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::MESSAGE_ID_TEST ( "MessageId_Test"  )
static

Message Id for testing.

◆ MESSAGE_ID_TEST_2()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::MESSAGE_ID_TEST_2 ( "MessageId_Test_2"  )
static

Message Id for testing.

◆ MY_WAIT_TIMEOUT()

static const std::chrono::milliseconds alexaClientSDK::capabilityAgents::speechSynthesizer::test::MY_WAIT_TIMEOUT ( 1000  )
static

Plenty of time for a test to complete.

◆ NAME_RECOGNIZE()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::NAME_RECOGNIZE ( "Recognize"  )
static

Wrong name for testing.

◆ NAME_SPEAK()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::NAME_SPEAK ( "Speak"  )
static

Name for SpeechSynthesizer directive.

◆ NAMESPACE_SPEECH_SYNTHESIZER()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::NAMESPACE_SPEECH_SYNTHESIZER ( "SpeechSynthesizer"  )
static

Namespace for SpeechSynthesizer.

◆ STATE_CHANGE_TIMEOUT()

static const std::chrono::milliseconds alexaClientSDK::capabilityAgents::speechSynthesizer::test::STATE_CHANGE_TIMEOUT ( 10000  )
static

Time to wait for state change timeout. This should be set to be longer than STATE_CHANGE_TIMEOUT in SpeechSynthesizer.

◆ TEST_F() [1/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_createWithNullAudioPipelineFactoryFails   
)

Test creating SpeechSynthesizer fails with null audio pipeline factory.

◆ TEST_F() [2/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_callingHandleImmediately   
)

Test call to handleDirectiveImmediately. Expected result is that acquireChannel is called with the correct channel. On focus changed FOREGROUND, audio should play. Expect the ContextManager setState is called when state changes to PLAYING.

◆ TEST_F() [3/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_callingHandle   
)

Tests preHandleDirective and HandleDirective Call preHandle with a valid SPEAK directive. Then call handleDirective. Expected result is that acquireChannel is called with the correct channel. On focus changed FOREGROUND, audio should play. Expect the ContextManager setState is called when state changes to PLAYING.

◆ TEST_F() [4/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_callingCancel   
)

Tests cancelDirective. Call preHandle with a valid SPEAK directive. Then call cancelDirective. Expect that neither setState nor sendMessage are called since handle was never called to start playing audio.

◆ TEST_F() [5/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_callingCancelAfterHandle   
)

Testing cancelDirective after calling Call preHandle with a valid SPEAK directive. Then call handleDirective. Expected result is that acquireChannel is called once. On Focus Changed to foreground, audio should play. Call cancel directive. Expect the ContextManager setState is called when the state changes to PLAYING and then to INTERRUPTED. Expect sendMessage is called twice (SpeechStarted and SpeechInterrupted). Expect setFailed() is never called.

◆ TEST_F() [6/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_callingProvideStateWhenNotPlaying   
)

Testing provideState. Call provideState and expect that setState is called.

◆ TEST_F() [7/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_callingProvideStateWhenPlaying   
)

Testing provideState when playing. Call provideState after the state of the SpeechSynthesizer has changed to PLAYING. Expect getOffset is called. Expect setState is called when state changes and when state is requested via provideState.

◆ TEST_F() [8/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
testTimer_bargeInWhilePlaying   
)

Testing barge-in via handleDirectiveImmediately when audio is playing back. Call handleDirective. Once playback started notification is received, call handleDirectiveImmediately.

◆ TEST_F() [9/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
testTimer_notCallStopTwice   
)

Testing SpeechSynthesizer won't be calling stop() in MediaPlayer twice. Call preHandle with a valid SPEAK directive. Then call handleDirective. Expected result is that acquireChannel is called once. On Focus Changed to foreground, audio should play. Call cancel directive. Expect the stop() to be called once. Call onFocusChanged, expect the stop() to not be called again. Expect when handleDirectiveImmediately with a valid SPEAK directive is called, SpeechSynthesizer will react correctly.

◆ TEST_F() [10/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
testSlow_callingCancelBeforeOnFocusChanged   
)

Testing executeCancel() completes execution before onFocusChanged() is called.

The directive that was cancelled should never play. The second speech should play without any problem.

◆ TEST_F() [11/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_callingCancelBeforeOnExecuteStateChanged   
)

Testing executeCancel() completes execution before executeStateChange() is called.

◆ TEST_F() [12/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_mediaPlayerFailedToStop   
)

Testing SpeechSynthesizer will continue to function properly if stop() in MediaPlayer returned with an error. Call preHandle with a valid SPEAK directive. Then call handleDirective. Expected result is that acquireChannel is called once. On Focus Changed to foreground, audio should play. Call cancel directive. Expect the stop() to be called once, and we force MediaPlayer to return an error. Expect when handleDirectiveImmediately with a valid SPEAK directive is called, SpeechSynthesizer will react correctly.

◆ TEST_F() [13/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
testTimer_mediaPlayerAlwaysFailToStop   
)

Test SpeechSynthesizer shutdown when speech is playing and MediaPlayerInterface.stop() fails (ACSDK-1859).

Expected result is that shutdown should succeeded no matter the stop return.

◆ TEST_F() [14/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
testSlow_setStateTimeout   
)

Testing SpeechSynthesizer will call stop() if the SpeechSynthesizer experienced a state change timeout to PLAYING state.

◆ TEST_F() [15/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_givenPlayingStateFocusBecomesNone   
)

Testing changing focus state to NONE (local stop) during a speak. Expect setFailed to be called so any subsequent directives with the same dialogRequestId will be dropped.

◆ TEST_F() [16/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
testTimer_onPlayedStopped   
)

Testing SpeechSynthesizer will call setFailed() if the SpeechSynthesizer got a onPlaybackStopped() callback while it is in PLAYING state.

◆ TEST_F() [17/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_replaceAllWithEmptyQueue   
)

Test SpeechSynthesizer REPLACE_ALL when there is no active directive.

Expect the speech synthesizer to play the new speech and go to idle after.

◆ TEST_F() [18/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_replaceAllWithNonEmptyQueue   
)

Test SpeechSynthesizer REPLACE_ALL when the queue has one speak directive that hasn't started yet.

Expect the speech synthesizer to cancel the enqueued directive and play the new speech.

◆ TEST_F() [19/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_replaceAllStopActiveSpeech   
)

Test SpeechSynthesizer REPLACE_ALL when there is an ongoing speech.

Expect the speech synthesizer to cancel the active speech, send a completed event and play the new speech.

◆ TEST_F() [20/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_enqueueWithActiveSpeech   
)

Test SpeechSynthesizer ENQUEUE play behavior when there is already an active directive.

Expect the speech synthesizer to finish playing the first directive and play the enqueued directive right after.

◆ TEST_F() [21/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_replaceEnqueuedWithAnotherEnqueuedItem   
)

Test SpeechSynthesizer REPLACE_ENQUEUED play behavior when there is one directive playing and one in the queue.

Expect the speech synthesizer to finish playing the first directive, skip the second and play the third directive.

◆ TEST_F() [22/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_parsingSingleAnalyzerConfig   
)

Test call to test audio analyzer config parsing logic.

◆ TEST_F() [23/23]

alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F ( SpeechSynthesizerTest  ,
test_parsingMultipleAnalyzerConfig   
)

◆ TOKEN_TEST()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::TOKEN_TEST ( "Token_Test"  )
static

Token for testing.

◆ URL_TEST()

static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::URL_TEST ( "cid:Test"  )
static

URL for testing.

Variable Documentation

◆ CAPTION_CONTENT_SAMPLE

const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::CAPTION_CONTENT_SAMPLE
static
Initial value:
=
"WEBVTT\\n"
"\\n"
"1\\n"
"00:00.000 --> 00:01.260\\n"
"The time is 2:17 PM."

◆ DEFAULT_MEDIA_PLAYER_STATE

const MediaPlayerState alexaClientSDK::capabilityAgents::speechSynthesizer::test::DEFAULT_MEDIA_PLAYER_STATE = {std::chrono::milliseconds(0)}
static

Default media player state for all playback events.

◆ FINISHED_STATE_TEST

const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::FINISHED_STATE_TEST
static
Initial value:
=
"{"
"\"token\":\"" + TOKEN_TEST + "\","
"\"offsetInMilliseconds\":" + std::to_string(0) + ","
"\"playerActivity\":\"" + FINISHED_STATE + "\""
"}"
static const std::string TOKEN_TEST("Token_Test")
Token for testing.
static const std::string FINISHED_STATE("FINISHED")
The FINISHED state of the SpeechSynthesizer.

The expected state when the SpeechSynthesizer is in FINISHED state.

◆ IDLE_STATE_TEST

const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::IDLE_STATE_TEST
static
Initial value:
=
"{"
"\"token\":\"\","
"\"offsetInMilliseconds\":" + std::to_string(0) + ","
"\"playerActivity\":\"" + FINISHED_STATE + "\""
"}"
static const std::string FINISHED_STATE("FINISHED")
The FINISHED state of the SpeechSynthesizer.

The expected state when the SpeechSynthesizer is not handling any directive.

◆ INTERRUPTED_STATE

const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::INTERRUPTED_STATE {"INTERRUPTED"}
static

The INTERRUPTED state of the SpeechSynthesizer.

◆ INTERRUPTED_STATE_TEST

const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::INTERRUPTED_STATE_TEST
static
Initial value:
=
"{"
"\"token\":\"" + TOKEN_TEST + "\","
"\"offsetInMilliseconds\":" + std::to_string(OFFSET_IN_MILLISECONDS_TEST) + ","
"\"playerActivity\":\"" + INTERRUPTED_STATE + "\""
"}"
static const std::string TOKEN_TEST("Token_Test")
Token for testing.
static const long OFFSET_IN_MILLISECONDS_TEST
The offset in milliseconds returned by the mock media player.
Definition: SpeechSynthesizerTest.cpp:181
static const std::string INTERRUPTED_STATE
The INTERRUPTED state of the SpeechSynthesizer.
Definition: SpeechSynthesizerTest.cpp:178

The expected state when the SpeechSynthesizer is in INTERRUPTED state.

◆ NAMESPACE_AND_NAME_SPEECH_STATE

const NamespaceAndName alexaClientSDK::capabilityAgents::speechSynthesizer::test::NAMESPACE_AND_NAME_SPEECH_STATE {NAMESPACE_SPEECH_SYNTHESIZER, "SpeechState"}
static

The NamespaceAndName to send to the ContextManager.

◆ OFFSET_IN_CHRONO_MILLISECONDS_TEST

const std::chrono::milliseconds alexaClientSDK::capabilityAgents::speechSynthesizer::test::OFFSET_IN_CHRONO_MILLISECONDS_TEST {100}
static

An std::chrono::milliseconds representation of the offset.

◆ OFFSET_IN_MILLISECONDS_TEST

const long alexaClientSDK::capabilityAgents::speechSynthesizer::test::OFFSET_IN_MILLISECONDS_TEST {100}
static

The offset in milliseconds returned by the mock media player.

◆ PAYLOAD_TEST

const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::PAYLOAD_TEST
static
Initial value:
=
"{"
"\"url\":\"" + URL_TEST + "\","
"\"format\":\"" + FORMAT_TEST + "\","
"\"token\":\""+ TOKEN_TEST + "\","
"\"caption\": {"
"\"content\":\"" + CAPTION_CONTENT_SAMPLE + "\","
"\"type\":\"WEBVTT\""
"}"
"}"
static const std::string CAPTION_CONTENT_SAMPLE
Definition: SpeechSynthesizerTest.cpp:117
static const std::string TOKEN_TEST("Token_Test")
Token for testing.
static const std::string FORMAT_TEST("AUDIO_MPEG")
Format of the audio.
static const std::string URL_TEST("cid:Test")
URL for testing.

A payload for testing.

◆ PAYLOAD_TEST_MULTIPLE_ANALYZER

const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::PAYLOAD_TEST_MULTIPLE_ANALYZER
static
Initial value:
=
"{"
"\"url\":\"" + URL_TEST + "\","
"\"format\":\"" + FORMAT_TEST + "\","
"\"token\":\""+ TOKEN_TEST + "\","
"\"caption\": {"
"\"content\":\"" + CAPTION_CONTENT_SAMPLE + "\","
"\"type\":\"WEBVTT\""
"},"
"\"analyzers\":["
"{\"interface\":\"analyzername1\", \"enabled\":\"YES\"},"
"{\"interface\":\"analyzername2\", \"enabled\":\"NO\"}"
"]"
"}"
static const std::string CAPTION_CONTENT_SAMPLE
Definition: SpeechSynthesizerTest.cpp:117
static const std::string TOKEN_TEST("Token_Test")
Token for testing.
static const std::string FORMAT_TEST("AUDIO_MPEG")
Format of the audio.
static const std::string URL_TEST("cid:Test")
URL for testing.

A payload for testing with multiple audio analyzer entry.

◆ PAYLOAD_TEST_SINGLE_ANALYZER

const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::PAYLOAD_TEST_SINGLE_ANALYZER
static
Initial value:
=
"{"
"\"url\":\"" + URL_TEST + "\","
"\"format\":\"" + FORMAT_TEST + "\","
"\"token\":\""+ TOKEN_TEST + "\","
"\"caption\": {"
"\"content\":\"" + CAPTION_CONTENT_SAMPLE + "\","
"\"type\":\"WEBVTT\""
"},"
"\"analyzers\":[{\"interface\":\"analyzername\", \"enabled\":\"YES\"}]"
"}"
static const std::string CAPTION_CONTENT_SAMPLE
Definition: SpeechSynthesizerTest.cpp:117
static const std::string TOKEN_TEST("Token_Test")
Token for testing.
static const std::string FORMAT_TEST("AUDIO_MPEG")
Format of the audio.
static const std::string URL_TEST("cid:Test")
URL for testing.

A payload for testing with single audio analyzer entry.

◆ PLAYING_STATE

const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::PLAYING_STATE {"PLAYING"}
static

The PLAYING state of the SpeechSynthesizer.

◆ PLAYING_STATE_TEST

const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::PLAYING_STATE_TEST
static
Initial value:
=
"{"
"\"token\":\"" + TOKEN_TEST + "\","
"\"offsetInMilliseconds\":" + std::to_string(OFFSET_IN_MILLISECONDS_TEST) + ","
"\"playerActivity\":\"" + PLAYING_STATE + "\""
"}"
static const std::string TOKEN_TEST("Token_Test")
Token for testing.
static const std::string PLAYING_STATE
The PLAYING state of the SpeechSynthesizer.
Definition: SpeechSynthesizerTest.cpp:175
static const long OFFSET_IN_MILLISECONDS_TEST
The offset in milliseconds returned by the mock media player.
Definition: SpeechSynthesizerTest.cpp:181

The expected state when the SpeechSynthesizer is in PLAYING state.

◆ PROVIDE_STATE_TOKEN_TEST

const unsigned int alexaClientSDK::capabilityAgents::speechSynthesizer::test::PROVIDE_STATE_TOKEN_TEST {1}
static

Provide State Token for testing.

◆ SPEECH_FINISHED_EVENT_NAME

std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::SPEECH_FINISHED_EVENT_NAME {"SpeechFinished"}
static

The name of the event to send to the AVS server once audio finishes playing.

◆ SPEECH_INTERRUPTED_EVENT_NAME

std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::SPEECH_INTERRUPTED_EVENT_NAME {"SpeechInterrupted"}
static

The name of the event to send to the AVS server once audio playing has been interrupted.

◆ SPEECH_STARTED_EVENT_NAME

std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::SPEECH_STARTED_EVENT_NAME {"SpeechStarted"}
static

The name of the event to send to the AVS server once audio starting playing.

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