AWS SDK for C++

AWS SDK for C++ Version 1.11.820

Loading...
Searching...
No Matches
AudioStream.h
1
6#pragma once
7#include <aws/core/utils/event/EventStream.h>
8#include <aws/core/utils/stream/HttpWriteDataStreamBuf.h>
9#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
10#include <aws/transcribestreaming/model/AudioEvent.h>
11#include <aws/transcribestreaming/model/ConfigurationEvent.h>
12
13#include <utility>
14
15namespace Aws {
16namespace TranscribeStreamingService {
17namespace Model {
18
27class AWS_TRANSCRIBESTREAMINGSERVICE_API AudioStream : public Aws::Utils::Event::EventEncoderStream {
28 public:
29 AudioStream() = default;
30 explicit AudioStream(std::shared_ptr<Aws::Utils::Stream::HttpWriteDataStreamBuf> streambuf)
31 : Aws::Utils::Event::EventEncoderStream(std::move(streambuf)) {}
34 if (!value.GetAudioChunk().empty()) {
35 msg.InsertEventHeader(":message-type", Aws::String("event"));
36 msg.InsertEventHeader(":event-type", Aws::String("AudioEvent"));
37 msg.InsertEventHeader(":content-type", Aws::String("application/octet-stream"));
39 }
40 WriteEvent(msg);
41 return *this;
42 }
45 msg.InsertEventHeader(":message-type", Aws::String("event"));
46 msg.InsertEventHeader(":event-type", Aws::String("ConfigurationEvent"));
47 msg.InsertEventHeader(":content-type", Aws::String("application/json"));
49 WriteEvent(msg);
50 return *this;
51 }
52};
53
54} // namespace Model
55} // namespace TranscribeStreamingService
56} // namespace Aws
const Aws::Vector< unsigned char > & GetAudioChunk() const
Definition AudioEvent.h:41
AudioStream & WriteConfigurationEvent(const ConfigurationEvent &value)
Definition AudioStream.h:43
AudioStream(std::shared_ptr< Aws::Utils::Stream::HttpWriteDataStreamBuf > streambuf)
Definition AudioStream.h:30
AudioStream & WriteAudioEvent(const AudioEvent &value)
Definition AudioStream.h:32
AWS_TRANSCRIBESTREAMINGSERVICE_API Aws::Utils::Json::JsonValue Jsonize() const
void WriteEventPayload(const unsigned char *data, size_t length)
void InsertEventHeader(const Aws::String &headerName, const EventHeaderValue &eventHeaderValue)
Aws::String WriteCompact(bool treatAsObject=true) const
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String