StartMedicalStreamTranscription - Amazon Transcribe

StartMedicalStreamTranscription

Starts a bidirectional HTTP/2 stream where audio is streamed to Amazon Transcribe Medical and the transcription results are streamed to your application.

Request Syntax

POST /medical-stream-transcription HTTP/2 x-amzn-transcribe-language-code: LanguageCode x-amzn-transcribe-sample-rate: MediaSampleRateHertz x-amzn-transcribe-media-encoding: MediaEncoding x-amzn-transcribe-vocabulary-name: VocabularyName x-amzn-transcribe-specialty: Specialty x-amzn-transcribe-type: Type x-amzn-transcribe-show-speaker-label: ShowSpeakerLabel x-amzn-transcribe-session-id: SessionId x-amzn-transcribe-enable-channel-identification: EnableChannelIdentification x-amzn-transcribe-number-of-channels: NumberOfChannels x-amzn-transcribe-content-identification-type: ContentIdentificationType Content-type: application/json { "AudioStream": { "AudioEvent": { "AudioChunk": blob } } }

URI Request Parameters

The request uses the following URI parameters.

ContentIdentificationType

Set this field to PHI to identify personal health information in the transcription output.

Valid Values: PHI

EnableChannelIdentification

When true, instructs Amazon Transcribe Medical to process each audio channel separately and then merge the transcription output of each channel into a single transcription.

Amazon Transcribe Medical also produces a transcription of each item. An item includes the start time, end time, and any alternative transcriptions.

You can't set both ShowSpeakerLabel and EnableChannelIdentification in the same request. If you set both, your request returns a BadRequestException.

LanguageCode

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

Valid Values: en-US | en-GB | es-US | fr-CA | fr-FR | en-AU | it-IT | de-DE | pt-BR | ja-JP | ko-KR | zh-CN

Required: Yes

MediaEncoding

The encoding used for the input audio.

Valid Values: pcm | ogg-opus | flac

Required: Yes

MediaSampleRateHertz

The sample rate of the input audio in Hertz. Sample rates of 16000 Hz or higher are accepted.

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

Required: Yes

NumberOfChannels

The number of channels that are in your audio stream.

Valid Range: Minimum value of 2.

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.

Length Constraints: Fixed length of 36.

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}

ShowSpeakerLabel

When true, enables speaker identification in your real-time stream.

Specialty

The medical specialty of the clinician or provider.

Valid Values: PRIMARYCARE | CARDIOLOGY | NEUROLOGY | ONCOLOGY | RADIOLOGY | UROLOGY

Required: Yes

Type

The type of input audio. Choose DICTATION for a provider dictating patient notes. Choose CONVERSATION for a dialogue between a patient and one or more medical professionanls.

Valid Values: CONVERSATION | DICTATION

Required: Yes

VocabularyName

The name of the medical custom vocabulary to use when processing the real-time stream.

Length Constraints: Minimum length of 1. Maximum length of 200.

Pattern: ^[0-9a-zA-Z._-]+

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-vocabulary-name: VocabularyName x-amzn-transcribe-specialty: Specialty x-amzn-transcribe-type: Type x-amzn-transcribe-show-speaker-label: ShowSpeakerLabel x-amzn-transcribe-session-id: SessionId x-amzn-transcribe-enable-channel-identification: EnableChannelIdentification x-amzn-transcribe-number-of-channels: NumberOfChannels x-amzn-transcribe-content-identification-type: ContentIdentificationType Content-type: application/json { "TranscriptResultStream": { "BadRequestException": { }, "ConflictException": { }, "InternalFailureException": { }, "LimitExceededException": { }, "ServiceUnavailableException": { }, "TranscriptEvent": { "Transcript": { "Results": [ { "Alternatives": [ { "Entities": [ { "Category": "string", "Confidence": number, "Content": "string", "EndTime": number, "StartTime": number } ], "Items": [ { "Confidence": number, "Content": "string", "EndTime": number, "Speaker": "string", "StartTime": number, "Type": "string" } ], "Transcript": "string" } ], "ChannelId": "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.

ContentIdentificationType

If the value is PHI, indicates that you've configured your stream to identify personal health information.

Valid Values: PHI

EnableChannelIdentification

Shows whether channel identification has been enabled in the stream.

LanguageCode

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

Valid Values: en-US | en-GB | es-US | fr-CA | fr-FR | en-AU | it-IT | de-DE | pt-BR | ja-JP | ko-KR | zh-CN

MediaEncoding

The encoding used for the input audio stream.

Valid Values: pcm | ogg-opus | flac

MediaSampleRateHertz

The sample rate of the input audio in Hertz. Valid value: 16000 Hz.

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

NumberOfChannels

The number of channels identified in the stream.

Valid Range: Minimum value of 2.

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.

Length Constraints: Fixed length of 36.

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}

ShowSpeakerLabel

Shows whether speaker identification was enabled in the stream.

Specialty

The specialty in the medical domain.

Valid Values: PRIMARYCARE | CARDIOLOGY | NEUROLOGY | ONCOLOGY | RADIOLOGY | UROLOGY

Type

The type of audio that was transcribed.

Valid Values: CONVERSATION | DICTATION

VocabularyName

The name of the vocabulary used when processing the stream.

Length Constraints: Minimum length of 1. Maximum length of 200.

Pattern: ^[0-9a-zA-Z._-]+

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

TranscriptResultStream

Represents the stream of transcription events from Amazon Transcribe Medical to your application.

Type: MedicalTranscriptResultStream object

Errors

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

BadRequestException

One or more arguments to the StartStreamTranscription or StartMedicalStreamTranscription operation was invalid. For example, MediaEncoding was not set to a valid encoding, 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 or Amazon Transcribe Medical 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

ServiceUnavailableException

Service is currently unavailable. Try your request later.

HTTP Status Code: 503

See Also

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