AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
TestSpeechSynthesizerObserver.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_INTEGRATION_INCLUDE_INTEGRATION_TESTSPEECHSYNTHESIZEROBSERVER_H_
17 #define ALEXA_CLIENT_SDK_INTEGRATION_INCLUDE_INTEGRATION_TESTSPEECHSYNTHESIZEROBSERVER_H_
18 
19 #include <chrono>
20 #include <condition_variable>
21 #include <deque>
22 #include <mutex>
23 
25 
26 namespace alexaClientSDK {
27 namespace integration {
28 namespace test {
29 
34 public:
36 
38 
39  void onStateChanged(
43  const std::vector<avsCommon::utils::audioAnalyzer::AudioAnalyzerState>& audioAnalyzerState) override;
44 
45  bool checkState(
47  const std::chrono::seconds duration);
48 
50  const std::chrono::seconds duration);
51 
53 
54 private:
56  std::mutex m_mutex;
57  std::condition_variable m_wakeTrigger;
58  std::deque<avsCommon::sdkInterfaces::SpeechSynthesizerObserverInterface::SpeechSynthesizerState> m_queue;
59 };
60 
61 } // namespace test
62 } // namespace integration
63 } // namespace alexaClientSDK
64 
65 #endif // ALEXA_CLIENT_SDK_INTEGRATION_INCLUDE_INTEGRATION_TESTSPEECHSYNTHESIZEROBSERVER_H_
uint64_t SourceId
A type that identifies which source is currently being operated on. This must be unique across all in...
Definition: MediaPlayerInterface.h:69
avsCommon::sdkInterfaces::SpeechSynthesizerObserverInterface::SpeechSynthesizerState waitForNext(const std::chrono::seconds duration)
Definition: TestSpeechSynthesizerObserver.cpp:47
void onStateChanged(avsCommon::sdkInterfaces::SpeechSynthesizerObserverInterface::SpeechSynthesizerState state, const avsCommon::utils::mediaPlayer::MediaPlayerInterface::SourceId mediaSourceId, const avsCommon::utils::Optional< avsCommon::utils::mediaPlayer::MediaPlayerState > &mediaPlayerState, const std::vector< avsCommon::utils::audioAnalyzer::AudioAnalyzerState > &audioAnalyzerState) override
Definition: TestSpeechSynthesizerObserver.cpp:28
Definition: TestSpeechSynthesizerObserver.h:33
bool checkState(const avsCommon::sdkInterfaces::SpeechSynthesizerObserverInterface::SpeechSynthesizerState expectedState, const std::chrono::seconds duration)
Definition: TestSpeechSynthesizerObserver.cpp:39
avsCommon::sdkInterfaces::SpeechSynthesizerObserverInterface::SpeechSynthesizerState getCurrentState()
Definition: TestSpeechSynthesizerObserver.cpp:60
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: SpeechSynthesizerObserverInterface.h:32
SpeechSynthesizerState
Definition: SpeechSynthesizerObserverInterface.h:37
TestSpeechSynthesizerObserver()
Definition: TestSpeechSynthesizerObserver.cpp:24

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