AlexaClientSDK  1.23.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
SpeechSynthesizerObserverInterface.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_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_SPEECHSYNTHESIZEROBSERVERINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_SPEECHSYNTHESIZEROBSERVERINTERFACE_H_
18 
19 #include <iostream>
20 #include <vector>
21 
24 
25 namespace alexaClientSDK {
26 namespace avsCommon {
27 namespace sdkInterfaces {
28 
33 public:
39  PLAYING,
40 
42  FINISHED,
43 
46 
49 
52  };
53 
57  virtual ~SpeechSynthesizerObserverInterface() = default;
58 
67  virtual void onStateChanged(
71  const std::vector<avsCommon::utils::audioAnalyzer::AudioAnalyzerState>& audioAnalyzerState) = 0;
72 };
73 
81 inline std::ostream& operator<<(
82  std::ostream& stream,
84  switch (state) {
86  stream << "PLAYING";
87  break;
89  stream << "FINISHED";
90  break;
92  stream << "INTERRUPTED";
93  break;
95  stream << "GAINING_FOCUS";
96  break;
98  stream << "LOSING_FOCUS";
99  break;
100  }
101  return stream;
102 }
103 
104 } // namespace sdkInterfaces
105 } // namespace avsCommon
106 } // namespace alexaClientSDK
107 
108 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_SPEECHSYNTHESIZEROBSERVERINTERFACE_H_
std::ostream & operator<<(std::ostream &stream, const AudioInputProcessorObserverInterface::State &state)
Definition: AudioInputProcessorObserverInterface.h:86
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
In this state, the SpeechSynthesizer is losing the channel focus but not yet considered FINISHED...
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
virtual void onStateChanged(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)=0
In this state, the SpeechSynthesizer is gaining the channel focus while still not playing anything...
Definition: SpeechSynthesizerObserverInterface.h:32
SpeechSynthesizerState
Definition: SpeechSynthesizerObserverInterface.h:37

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