/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace Aws
{
namespace Http
{
class HttpClient;
class HttpClientFactory;
} // namespace Http
namespace Utils
{
template< typename R, typename E> class Outcome;
namespace Event
{
class EventEncoderStream;
}
namespace Threading
{
class Executor;
} // namespace Threading
} // namespace Utils
namespace Auth
{
class AWSCredentials;
class AWSCredentialsProvider;
} // namespace Auth
namespace Client
{
class RetryStrategy;
} // namespace Client
namespace TranscribeStreamingService
{
namespace Model
{
class StartStreamTranscriptionRequest;
class AudioStream;
typedef Aws::Utils::Outcome StartStreamTranscriptionOutcome;
typedef std::future StartStreamTranscriptionOutcomeCallable;
} // namespace Model
class TranscribeStreamingServiceClient;
typedef std::function StartStreamTranscriptionStreamReadyHandler;
typedef std::function&) > StartStreamTranscriptionResponseReceivedHandler;
/**
* Operations and objects for transcribing streaming speech to text.
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API TranscribeStreamingServiceClient : public Aws::Client::AWSJsonClient
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
TranscribeStreamingServiceClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
TranscribeStreamingServiceClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
TranscribeStreamingServiceClient(const std::shared_ptr& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
virtual ~TranscribeStreamingServiceClient();
/**
* Starts a bidirectional HTTP2 stream where audio is streamed to Amazon
* Transcribe and the transcription results are streamed to your application.
* The following are encoded as HTTP2 headers:
-
*
x-amzn-transcribe-language-code
-
*
x-amzn-transcribe-media-encoding
-
*
x-amzn-transcribe-sample-rate
-
*
x-amzn-transcribe-session-id
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor.
* The streamReadyHandler is triggered when the stream is ready to be written to.
* The responseHandler is triggered when the request is finished.
*/
virtual void StartStreamTranscriptionAsync(Model::StartStreamTranscriptionRequest& request,
const StartStreamTranscriptionStreamReadyHandler& streamReadyHandler,
const StartStreamTranscriptionResponseReceivedHandler& responseHandler,
const std::shared_ptr& handlerContext = nullptr) const;
void OverrideEndpoint(const Aws::String& endpoint);
private:
void init(const Aws::Client::ClientConfiguration& clientConfiguration);
Aws::String m_uri;
Aws::String m_configScheme;
std::shared_ptr m_executor;
};
} // namespace TranscribeStreamingService
} // namespace Aws