2019/09/24 - Amazon Transcribe Service - 1 updated api methods
Changes With this update Amazon Transcribe enables you to provide an AWS KMS key to encrypt your transcription output.
{'OutputEncryptionKMSKeyId': 'string'}
Starts an asynchronous job to transcribe speech to text.
See also: AWS API Documentation
Request Syntax
client.start_transcription_job( TranscriptionJobName='string', LanguageCode='en-US'|'es-US'|'en-AU'|'fr-CA'|'en-GB'|'de-DE'|'pt-BR'|'fr-FR'|'it-IT'|'ko-KR'|'es-ES'|'en-IN'|'hi-IN'|'ar-SA'|'ru-RU'|'zh-CN', MediaSampleRateHertz=123, MediaFormat='mp3'|'mp4'|'wav'|'flac', Media={ 'MediaFileUri': 'string' }, OutputBucketName='string', OutputEncryptionKMSKeyId='string', Settings={ 'VocabularyName': 'string', 'ShowSpeakerLabels': True|False, 'MaxSpeakerLabels': 123, 'ChannelIdentification': True|False } )
string
[REQUIRED]
The name of the job. Note that you can't use the strings "." or ".." by themselves as the job name. The name must also be unique within an AWS account.
string
[REQUIRED]
The language code for the language used in the input media file.
integer
The sample rate, in Hertz, of the audio track in the input media file.
If you do not specify the media sample rate, Amazon Transcribe determines the sample rate. If you specify the sample rate, it must match the sample rate detected by Amazon Transcribe. In most cases, you should leave the MediaSampleRateHertz field blank and let Amazon Transcribe determine the sample rate.
string
The format of the input media file.
dict
[REQUIRED]
An object that describes the input media for a transcription job.
MediaFileUri (string) --
The S3 location of the input media file. The URI must be in the same region as the API endpoint that you are calling. The general form is:
https://s3-<aws-region>.amazonaws.com/<bucket-name>/<keyprefix>/<objectkey>
For example:
https://s3-us-east-1.amazonaws.com/examplebucket/example.mp4
https://s3-us-east-1.amazonaws.com/examplebucket/mediadocs/example.mp4
For more information about S3 object names, see Object Keys in the Amazon S3 Developer Guide .
string
The location where the transcription is stored.
If you set the OutputBucketName , Amazon Transcribe puts the transcription in the specified S3 bucket. When you call the GetTranscriptionJob operation, the operation returns this location in the TranscriptFileUri field. The S3 bucket must have permissions that allow Amazon Transcribe to put files in the bucket. For more information, see Permissions Required for IAM User Roles .
Amazon Transcribe uses the default Amazon S3 key for server-side encryption of transcripts that are placed in your S3 bucket. You can't specify your own encryption key.
If you don't set the OutputBucketName , Amazon Transcribe generates a pre-signed URL, a shareable URL that provides secure access to your transcription, and returns it in the TranscriptFileUri field. Use this URL to download the transcription.
string
dict
A Settings object that provides optional settings for a transcription job.
VocabularyName (string) --
The name of a vocabulary to use when processing the transcription job.
ShowSpeakerLabels (boolean) --
Determines whether the transcription job uses speaker recognition to identify different speakers in the input audio. Speaker recognition labels individual speakers in the audio file. If you set the ShowSpeakerLabels field to true, you must also set the maximum number of speaker labels MaxSpeakerLabels field.
You can't set both ShowSpeakerLabels and ChannelIdentification in the same request. If you set both, your request returns a BadRequestException .
MaxSpeakerLabels (integer) --
The maximum number of speakers to identify in the input audio. If there are more speakers in the audio than this number, multiple speakers will be identified as a single speaker. If you specify the MaxSpeakerLabels field, you must set the ShowSpeakerLabels field to true.
ChannelIdentification (boolean) --
Instructs Amazon Transcribe to process each audio channel separately and then merge the transcription output of each channel into a single transcription.
Amazon Transcribe also produces a transcription of each item detected on an audio channel, including the start time and end time of the item and alternative transcriptions of the item including the confidence that Amazon Transcribe has in the transcription.
You can't set both ShowSpeakerLabels and ChannelIdentification in the same request. If you set both, your request returns a BadRequestException .
dict
Response Syntax
{ 'TranscriptionJob': { 'TranscriptionJobName': 'string', 'TranscriptionJobStatus': 'IN_PROGRESS'|'FAILED'|'COMPLETED', 'LanguageCode': 'en-US'|'es-US'|'en-AU'|'fr-CA'|'en-GB'|'de-DE'|'pt-BR'|'fr-FR'|'it-IT'|'ko-KR'|'es-ES'|'en-IN'|'hi-IN'|'ar-SA'|'ru-RU'|'zh-CN', 'MediaSampleRateHertz': 123, 'MediaFormat': 'mp3'|'mp4'|'wav'|'flac', 'Media': { 'MediaFileUri': 'string' }, 'Transcript': { 'TranscriptFileUri': 'string' }, 'CreationTime': datetime(2015, 1, 1), 'CompletionTime': datetime(2015, 1, 1), 'FailureReason': 'string', 'Settings': { 'VocabularyName': 'string', 'ShowSpeakerLabels': True|False, 'MaxSpeakerLabels': 123, 'ChannelIdentification': True|False } } }
Response Structure
(dict) --
TranscriptionJob (dict) --
An object containing details of the asynchronous transcription job.
TranscriptionJobName (string) --
The name of the transcription job.
TranscriptionJobStatus (string) --
The status of the transcription job.
LanguageCode (string) --
The language code for the input speech.
MediaSampleRateHertz (integer) --
The sample rate, in Hertz, of the audio track in the input media file.
MediaFormat (string) --
The format of the input media file.
Media (dict) --
An object that describes the input media for the transcription job.
MediaFileUri (string) --
The S3 location of the input media file. The URI must be in the same region as the API endpoint that you are calling. The general form is:
https://s3-<aws-region>.amazonaws.com/<bucket-name>/<keyprefix>/<objectkey>
For example:
https://s3-us-east-1.amazonaws.com/examplebucket/example.mp4
https://s3-us-east-1.amazonaws.com/examplebucket/mediadocs/example.mp4
For more information about S3 object names, see Object Keys in the Amazon S3 Developer Guide .
Transcript (dict) --
An object that describes the output of the transcription job.
TranscriptFileUri (string) --
The location where the transcription is stored.
Use this URI to access the transcription. If you specified an S3 bucket in the OutputBucketName field when you created the job, this is the URI of that bucket. If you chose to store the transcription in Amazon Transcribe, this is a shareable URL that provides secure access to that location.
CreationTime (datetime) --
A timestamp that shows when the job was created.
CompletionTime (datetime) --
A timestamp that shows when the job was completed.
FailureReason (string) --
If the TranscriptionJobStatus field is FAILED , this field contains information about why the job failed.
The FailureReason field can contain one of the following values:
Unsupported media format - The media format specified in the MediaFormat field of the request isn't valid. See the description of the MediaFormat field for a list of valid values.
The media format provided does not match the detected media format - The media format of the audio file doesn't match the format specified in the MediaFormat field in the request. Check the media format of your media file and make sure that the two values match.
Invalid sample rate for audio file - The sample rate specified in the MediaSampleRateHertz of the request isn't valid. The sample rate must be between 8000 and 48000 Hertz.
The sample rate provided does not match the detected sample rate - The sample rate in the audio file doesn't match the sample rate specified in the MediaSampleRateHertz field in the request. Check the sample rate of your media file and make sure that the two values match.
Invalid file size: file size too large - The size of your audio file is larger than Amazon Transcribe can process. For more information, see Limits in the Amazon Transcribe Developer Guide .
Invalid number of channels: number of channels too large - Your audio contains more channels than Amazon Transcribe is configured to process. To request additional channels, see Amazon Transcribe Limits in the Amazon Web Services General Reference .
Settings (dict) --
Optional settings for the transcription job. Use these settings to turn on speaker recognition, to set the maximum number of speakers that should be identified and to specify a custom vocabulary to use when processing the transcription job.
VocabularyName (string) --
The name of a vocabulary to use when processing the transcription job.
ShowSpeakerLabels (boolean) --
Determines whether the transcription job uses speaker recognition to identify different speakers in the input audio. Speaker recognition labels individual speakers in the audio file. If you set the ShowSpeakerLabels field to true, you must also set the maximum number of speaker labels MaxSpeakerLabels field.
You can't set both ShowSpeakerLabels and ChannelIdentification in the same request. If you set both, your request returns a BadRequestException .
MaxSpeakerLabels (integer) --
The maximum number of speakers to identify in the input audio. If there are more speakers in the audio than this number, multiple speakers will be identified as a single speaker. If you specify the MaxSpeakerLabels field, you must set the ShowSpeakerLabels field to true.
ChannelIdentification (boolean) --
Instructs Amazon Transcribe to process each audio channel separately and then merge the transcription output of each channel into a single transcription.
Amazon Transcribe also produces a transcription of each item detected on an audio channel, including the start time and end time of the item and alternative transcriptions of the item including the confidence that Amazon Transcribe has in the transcription.
You can't set both ShowSpeakerLabels and ChannelIdentification in the same request. If you set both, your request returns a BadRequestException .