Amazon Transcribe
Developer Guide

StartMedicalStreamTranscription

Starts a protocol where audio is streamed to Transcribe Medical and the transcription results are streamed to your application.

Request Syntax

POST /medical-stream-transcription HTTP/2 x-amzn-transcribe-medical-language-code: LanguageCode x-amzn-transcribe-medical-sample-rate: MediaSampleRateHertz x-amzn-transcribe-medical-media-encoding: MediaEncoding x-amzn-transcribe-medical-specialty: Specialty x-amzn-transcribe-medical-type: Type x-amzn-transcribe-medical-session-id: SessionId Content-type: application/json { "AudioStream": { "AudioEvent": { "AudioChunk": blob } } }

URI Request Parameters

The request requires the following URI parameters.

LanguageCode

Indicates the source language used in the input audio stream. For Transcribe Medical, this is US English (US-EN).

Valid Values: en-US | en-GB | es-US | fr-CA | fr-FR | en-AU

MediaEncoding

The encoding used for the input audio. The only valid value is pcm.

Valid Values: pcm

MediaSampleRateHertz

The sample rate of the input audio in Hertz. 16000 Hz or higher sample rates are accepted. Audio with sample rates lower than 16000 Hz can also be processed, but may produce to less accurate transcription results.

Valid Range: Minimum value of 8000. Maximum value of 48000.

SessionId

Optional. An identifier for the transcription session. If you don't provide a session ID, Amazon Transcribe generates one for you and returns it in the response.

Pattern: [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}

Specialty

The specialty in the medical domain. Must be PRIMARYCARE.

Valid Values: PRIMARYCARE

Type

The type of input audio. Must be DICTATION or CONVERSATION.

Valid Values: CONVERSATION | DICTATION

Request Body

The request accepts the following data in JSON format.

AudioStream

Represents the audio stream from your application to Amazon Transcribe.

Type: AudioStream object

Required: Yes

Response Syntax

HTTP/2 200 x-amzn-request-id: RequestId x-amzn-transcribe-language-code: LanguageCode x-amzn-transcribe-sample-rate: MediaSampleRateHertz x-amzn-transcribe-media-encoding: MediaEncoding x-amzn-transcribe-medical-specialty: Specialty x-amzn-transcribe-medical-type: Type x-amzn-transcribe-session-id: SessionId Content-type: application/json { "TranscriptResultStream": { "BadRequestException": { }, "ConflictException": { }, "InternalFailureException": { }, "LimitExceededException": { }, "TranscriptEvent": { "Transcript": { "Results": [ { "Alternatives": [ { "Items": [ { "Confidence": number, "Content": "string", "EndTime": number, "StartTime": number, "Type": "string" } ], "Transcript": "string" } ], "EndTime": number, "IsPartial": boolean, "ResultId": "string", "StartTime": number } ] } } } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The response returns the following HTTP headers.

LanguageCode

The language code for the response transcript. For Transcribe Medical, this will be US English (en-US).

Valid Values: en-US | en-GB | es-US | fr-CA | fr-FR | en-AU

MediaEncoding

The encoding used for the input audio stream.

Valid Values: pcm

MediaSampleRateHertz

Valid Range: Minimum value of 8000. Maximum value of 48000.

RequestId

An identifier for the streaming transcription.

SessionId

Optional. An identifier for the transcription session. If you don't provide a session ID, Amazon Transcribe generates one for you and returns it in the response.

Pattern: [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}

Specialty

The specialty in the medical domain. Must be PRIMARYCARE.

Valid Values: PRIMARYCARE

Type

The type of audio. Must be DICTATION or CONVERSATION.

Valid Values: CONVERSATION | DICTATION

The following data is returned in JSON format by the service.

TranscriptResultStream

Represents the transcription result stream from Amazon Transcribe to your application.

Type: TranscriptResultStream object

Errors

For information about the errors that are common to all actions, see Common Errors.

BadRequestException

One or more arguments to the StartStreamTranscription operation was invalid. For example, MediaEncoding was not set to pcm or LanguageCode was not set to a valid code. Check the parameters and try your request again.

HTTP Status Code: 400

ConflictException

A new stream started with the same session ID. The current stream has been terminated.

HTTP Status Code: 409

InternalFailureException

A problem occurred while processing the audio. Amazon Transcribe terminated processing. Try your request again.

HTTP Status Code: 500

LimitExceededException

You have exceeded the maximum number of concurrent transcription streams, are starting transcription streams too quickly, or the maximum audio length of 4 hours. Wait until a stream has finished processing, or break your audio stream into smaller chunks and try your request again.

HTTP Status Code: 429

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: