99 lines
2.8 KiB
C++
99 lines
2.8 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/transcribestreaming/model/StartStreamTranscriptionRequest.h>
|
|||
|
|
#include <aws/core/AmazonWebServiceResult.h>
|
|||
|
|
#include <aws/core/utils/memory/stl/AWSStringStream.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::TranscribeStreamingService::Model;
|
|||
|
|
using namespace Aws::Utils::Stream;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
using namespace Aws;
|
|||
|
|
|
|||
|
|
StartStreamTranscriptionRequest::StartStreamTranscriptionRequest() :
|
|||
|
|
m_languageCode(LanguageCode::NOT_SET),
|
|||
|
|
m_languageCodeHasBeenSet(false),
|
|||
|
|
m_mediaSampleRateHertz(0),
|
|||
|
|
m_mediaSampleRateHertzHasBeenSet(false),
|
|||
|
|
m_mediaEncoding(MediaEncoding::NOT_SET),
|
|||
|
|
m_mediaEncodingHasBeenSet(false),
|
|||
|
|
m_vocabularyNameHasBeenSet(false),
|
|||
|
|
m_sessionIdHasBeenSet(false),
|
|||
|
|
m_vocabularyFilterNameHasBeenSet(false),
|
|||
|
|
m_vocabularyFilterMethod(VocabularyFilterMethod::NOT_SET),
|
|||
|
|
m_vocabularyFilterMethodHasBeenSet(false),
|
|||
|
|
m_showSpeakerLabel(false),
|
|||
|
|
m_showSpeakerLabelHasBeenSet(false),
|
|||
|
|
m_decoder(Aws::Utils::Event::EventStreamDecoder(&m_handler))
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
std::shared_ptr<Aws::IOStream> StartStreamTranscriptionRequest::GetBody() const
|
|||
|
|
{
|
|||
|
|
return m_audioStream;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
Aws::Http::HeaderValueCollection StartStreamTranscriptionRequest::GetRequestSpecificHeaders() const
|
|||
|
|
{
|
|||
|
|
Aws::Http::HeaderValueCollection headers;
|
|||
|
|
headers.emplace(Aws::Http::CONTENT_TYPE_HEADER, Aws::AMZN_EVENTSTREAM_CONTENT_TYPE);
|
|||
|
|
Aws::StringStream ss;
|
|||
|
|
if(m_languageCodeHasBeenSet)
|
|||
|
|
{
|
|||
|
|
headers.emplace("x-amzn-transcribe-language-code", LanguageCodeMapper::GetNameForLanguageCode(m_languageCode));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_mediaSampleRateHertzHasBeenSet)
|
|||
|
|
{
|
|||
|
|
ss << m_mediaSampleRateHertz;
|
|||
|
|
headers.emplace("x-amzn-transcribe-sample-rate", ss.str());
|
|||
|
|
ss.str("");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_mediaEncodingHasBeenSet)
|
|||
|
|
{
|
|||
|
|
headers.emplace("x-amzn-transcribe-media-encoding", MediaEncodingMapper::GetNameForMediaEncoding(m_mediaEncoding));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_vocabularyNameHasBeenSet)
|
|||
|
|
{
|
|||
|
|
ss << m_vocabularyName;
|
|||
|
|
headers.emplace("x-amzn-transcribe-vocabulary-name", ss.str());
|
|||
|
|
ss.str("");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_sessionIdHasBeenSet)
|
|||
|
|
{
|
|||
|
|
ss << m_sessionId;
|
|||
|
|
headers.emplace("x-amzn-transcribe-session-id", ss.str());
|
|||
|
|
ss.str("");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_vocabularyFilterNameHasBeenSet)
|
|||
|
|
{
|
|||
|
|
ss << m_vocabularyFilterName;
|
|||
|
|
headers.emplace("x-amzn-transcribe-vocabulary-filter-name", ss.str());
|
|||
|
|
ss.str("");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_vocabularyFilterMethodHasBeenSet)
|
|||
|
|
{
|
|||
|
|
headers.emplace("x-amzn-transcribe-vocabulary-filter-method", VocabularyFilterMethodMapper::GetNameForVocabularyFilterMethod(m_vocabularyFilterMethod));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_showSpeakerLabelHasBeenSet)
|
|||
|
|
{
|
|||
|
|
ss << m_showSpeakerLabel;
|
|||
|
|
headers.emplace("x-amzn-transcribe-show-speaker-label", ss.str());
|
|||
|
|
ss.str("");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return headers;
|
|||
|
|
|
|||
|
|
}
|