Current section

Files

Jump to
aws lib aws generated transcribe_streaming.ex
Raw

lib/aws/generated/transcribe_streaming.ex

# WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
# See https://github.com/aws-beam/aws-codegen for more details.
defmodule AWS.TranscribeStreaming do
@moduledoc """
Operations and objects for transcribing streaming speech to text.
"""
alias AWS.Client
alias AWS.Request
def metadata do
%AWS.ServiceMetadata{
abbreviation: nil,
api_version: "2017-10-26",
content_type: "application/x-amz-json-1.1",
credential_scope: nil,
endpoint_prefix: "transcribestreaming",
global?: false,
protocol: "rest-json",
service_id: "Transcribe Streaming",
signature_version: "v4",
signing_name: "transcribe",
target_prefix: nil
}
end
@doc """
Starts a bidirectional HTTP/2 stream where audio is streamed to Amazon
Transcribe Medical and the transcription results are streamed to your
application.
"""
def start_medical_stream_transcription(%Client{} = client, input, options \\ []) do
url_path = "/medical-stream-transcription"
{headers, input} =
[
{"ContentIdentificationType", "x-amzn-transcribe-content-identification-type"},
{"EnableChannelIdentification", "x-amzn-transcribe-enable-channel-identification"},
{"LanguageCode", "x-amzn-transcribe-language-code"},
{"MediaEncoding", "x-amzn-transcribe-media-encoding"},
{"MediaSampleRateHertz", "x-amzn-transcribe-sample-rate"},
{"NumberOfChannels", "x-amzn-transcribe-number-of-channels"},
{"SessionId", "x-amzn-transcribe-session-id"},
{"ShowSpeakerLabel", "x-amzn-transcribe-show-speaker-label"},
{"Specialty", "x-amzn-transcribe-specialty"},
{"Type", "x-amzn-transcribe-type"},
{"VocabularyName", "x-amzn-transcribe-vocabulary-name"}
]
|> Request.build_params(input)
query_params = []
options =
Keyword.put(
options,
:response_header_parameters,
[
{"x-amzn-transcribe-content-identification-type", "ContentIdentificationType"},
{"x-amzn-transcribe-enable-channel-identification", "EnableChannelIdentification"},
{"x-amzn-transcribe-language-code", "LanguageCode"},
{"x-amzn-transcribe-media-encoding", "MediaEncoding"},
{"x-amzn-transcribe-sample-rate", "MediaSampleRateHertz"},
{"x-amzn-transcribe-number-of-channels", "NumberOfChannels"},
{"x-amzn-request-id", "RequestId"},
{"x-amzn-transcribe-session-id", "SessionId"},
{"x-amzn-transcribe-show-speaker-label", "ShowSpeakerLabel"},
{"x-amzn-transcribe-specialty", "Specialty"},
{"x-amzn-transcribe-type", "Type"},
{"x-amzn-transcribe-vocabulary-name", "VocabularyName"}
]
)
Request.request_rest(
client,
metadata(),
:post,
url_path,
query_params,
headers,
input,
options,
nil
)
end
@doc """
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
"""
def start_stream_transcription(%Client{} = client, input, options \\ []) do
url_path = "/stream-transcription"
{headers, input} =
[
{"EnableChannelIdentification", "x-amzn-transcribe-enable-channel-identification"},
{"EnablePartialResultsStabilization",
"x-amzn-transcribe-enable-partial-results-stabilization"},
{"LanguageCode", "x-amzn-transcribe-language-code"},
{"MediaEncoding", "x-amzn-transcribe-media-encoding"},
{"MediaSampleRateHertz", "x-amzn-transcribe-sample-rate"},
{"NumberOfChannels", "x-amzn-transcribe-number-of-channels"},
{"PartialResultsStability", "x-amzn-transcribe-partial-results-stability"},
{"SessionId", "x-amzn-transcribe-session-id"},
{"ShowSpeakerLabel", "x-amzn-transcribe-show-speaker-label"},
{"VocabularyFilterMethod", "x-amzn-transcribe-vocabulary-filter-method"},
{"VocabularyFilterName", "x-amzn-transcribe-vocabulary-filter-name"},
{"VocabularyName", "x-amzn-transcribe-vocabulary-name"}
]
|> Request.build_params(input)
query_params = []
options =
Keyword.put(
options,
:response_header_parameters,
[
{"x-amzn-transcribe-enable-channel-identification", "EnableChannelIdentification"},
{"x-amzn-transcribe-enable-partial-results-stabilization",
"EnablePartialResultsStabilization"},
{"x-amzn-transcribe-language-code", "LanguageCode"},
{"x-amzn-transcribe-media-encoding", "MediaEncoding"},
{"x-amzn-transcribe-sample-rate", "MediaSampleRateHertz"},
{"x-amzn-transcribe-number-of-channels", "NumberOfChannels"},
{"x-amzn-transcribe-partial-results-stability", "PartialResultsStability"},
{"x-amzn-request-id", "RequestId"},
{"x-amzn-transcribe-session-id", "SessionId"},
{"x-amzn-transcribe-show-speaker-label", "ShowSpeakerLabel"},
{"x-amzn-transcribe-vocabulary-filter-method", "VocabularyFilterMethod"},
{"x-amzn-transcribe-vocabulary-filter-name", "VocabularyFilterName"},
{"x-amzn-transcribe-vocabulary-name", "VocabularyName"}
]
)
Request.request_rest(
client,
metadata(),
:post,
url_path,
query_params,
headers,
input,
options,
nil
)
end
end