7#include <aws/core/client/AWSError.h>
8#include <aws/core/utils/HashingUtils.h>
9#include <aws/core/utils/event/EventStreamHandler.h>
10#include <aws/polly/PollyErrors.h>
11#include <aws/polly/Polly_EXPORTS.h>
12#include <aws/polly/model/AudioEvent.h>
13#include <aws/polly/model/StartSpeechSynthesisStreamInitialResponse.h>
14#include <aws/polly/model/StreamClosedEvent.h>
24 StartSpeechSynthesisStreamInitialResponseCallbackEx;
25 typedef std::function<void(
const AudioEvent&)> AudioEventCallback;
34 AWS_POLLY_API
virtual void OnEvent()
override;
44 m_onInitialResponse = callback;
51 return noArgCallback(rs);
62 AWS_POLLY_API
void HandleEventInMessage();
63 AWS_POLLY_API
void HandleErrorInMessage();
66 StartSpeechSynthesisStreamInitialResponseCallbackEx m_onInitialResponse;
67 AudioEventCallback m_onAudioEvent;
68 StreamClosedEventCallback m_onStreamClosedEvent;
69 ErrorCallback m_onError;
72namespace StartSpeechSynthesisStreamEventMapper {
AWS_POLLY_API StartSpeechSynthesisStreamHandler(const StartSpeechSynthesisStreamHandler &)=default
void SetInitialResponseCallbackEx(const StartSpeechSynthesisStreamInitialResponseCallbackEx &callback)
void SetStreamClosedEventCallback(const StreamClosedEventCallback &callback)
StartSpeechSynthesisStreamInitialResponseCallbackEx & GetInitialResponseCallbackEx()
AWS_POLLY_API StartSpeechSynthesisStreamHandler & operator=(const StartSpeechSynthesisStreamHandler &)=default
AWS_POLLY_API StartSpeechSynthesisStreamHandler()
void SetAudioEventCallback(const AudioEventCallback &callback)
void SetInitialResponseCallback(const StartSpeechSynthesisStreamInitialResponseCallback &noArgCallback)
void SetOnErrorCallback(const ErrorCallback &callback)
virtual AWS_POLLY_API void OnEvent() override
AWS_POLLY_API StartSpeechSynthesisStreamEventType GetStartSpeechSynthesisStreamEventTypeForName(const Aws::String &name)
AWS_POLLY_API Aws::String GetNameForStartSpeechSynthesisStreamEventType(StartSpeechSynthesisStreamEventType value)
StartSpeechSynthesisStreamEventType
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String