Skip to content

Commit

Permalink
feat(client-transcribe-streaming): This release enables customers to …
Browse files Browse the repository at this point in the history
…call the AWS Transcribe streaming service with the capability of identifying multiple languages in the stream.
  • Loading branch information
awstools committed Nov 13, 2023
1 parent 0b47053 commit 09ffb2a
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface StartStreamTranscriptionCommandOutput extends StartStreamTransc
* <ul>
* <li>
* <p>
* <code>language-code</code> or <code>identify-language</code>
* <code>language-code</code> or <code>identify-language</code> or <code>identify-multiple-language</code>
* </p>
* </li>
* <li>
Expand Down Expand Up @@ -115,6 +115,7 @@ export interface StartStreamTranscriptionCommandOutput extends StartStreamTransc
* IdentifyLanguage: true || false,
* LanguageOptions: "STRING_VALUE",
* PreferredLanguage: "en-US" || "en-GB" || "es-US" || "fr-CA" || "fr-FR" || "en-AU" || "it-IT" || "de-DE" || "pt-BR" || "ja-JP" || "ko-KR" || "zh-CN" || "hi-IN" || "th-TH",
* IdentifyMultipleLanguages: true || false,
* VocabularyNames: "STRING_VALUE",
* VocabularyFilterNames: "STRING_VALUE",
* };
Expand Down Expand Up @@ -205,6 +206,7 @@ export interface StartStreamTranscriptionCommandOutput extends StartStreamTransc
* // IdentifyLanguage: true || false,
* // LanguageOptions: "STRING_VALUE",
* // PreferredLanguage: "en-US" || "en-GB" || "es-US" || "fr-CA" || "fr-FR" || "en-AU" || "it-IT" || "de-DE" || "pt-BR" || "ja-JP" || "ko-KR" || "zh-CN" || "hi-IN" || "th-TH",
* // IdentifyMultipleLanguages: true || false,
* // VocabularyNames: "STRING_VALUE",
* // VocabularyFilterNames: "STRING_VALUE",
* // };
Expand Down
17 changes: 16 additions & 1 deletion clients/client-transcribe-streaming/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,7 @@ export interface StartStreamTranscriptionRequest {
* enabled channel identification, automatic language identification identifies the dominant language on
* each audio channel.</p>
* <p>Note that you must include either <code>LanguageCode</code> or
* <code>IdentifyLanguage</code> in your request. If you include both parameters, your request
* <code>IdentifyLanguage</code> or <code>IdentifyMultipleLanguages</code> in your request. If you include more than one of these parameters, your transcription job
* fails.</p>
* <p>Streaming language identification can't be combined with custom language models or
* redaction.</p>
Expand Down Expand Up @@ -2260,6 +2260,15 @@ export interface StartStreamTranscriptionRequest {
*/
PreferredLanguage?: LanguageCode;

/**
* @public
* <p>Enables automatic multi-language identification in your transcription job request. Use this parameter if your stream contains more than one language. If your stream contains only one language, use IdentifyLanguage instead.</p>
* <p>If you include <code>IdentifyMultipleLanguages</code>, you can optionally include a list of language codes, using <code>LanguageOptions</code>, that you think may be present in your stream. Including <code>LanguageOptions</code> restricts <code>IdentifyMultipleLanguages</code> to only the language options that you specify, which can improve transcription accuracy.</p>
* <p>If you want to apply a custom vocabulary or a custom vocabulary filter to your automatic multiple language identification request, include <code>VocabularyNames</code> or <code>VocabularyFilterNames</code>.</p>
* <p>Note that you must include one of <code>LanguageCode</code>, <code>IdentifyLanguage</code>, or <code>IdentifyMultipleLanguages</code> in your request. If you include more than one of these parameters, your transcription job fails.</p>
*/
IdentifyMultipleLanguages?: boolean;

/**
* @public
* <p>Specify the names of the custom vocabularies that you want to use when processing your
Expand Down Expand Up @@ -2608,6 +2617,12 @@ export interface StartStreamTranscriptionResponse {
*/
PreferredLanguage?: LanguageCode;

/**
* @public
* <p>Shows whether automatic multi-language identification was enabled for your transcription.</p>
*/
IdentifyMultipleLanguages?: boolean;

/**
* @public
* <p>Provides the names of the custom vocabularies that you specified in your request.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ export const se_StartStreamTranscriptionCommand = async (
],
"x-amzn-transcribe-language-options": input.LanguageOptions!,
"x-amzn-transcribe-preferred-language": input.PreferredLanguage!,
"x-amzn-transcribe-identify-multiple-languages": [
() => isSerializableHeaderValue(input.IdentifyMultipleLanguages),
() => input.IdentifyMultipleLanguages!.toString(),
],
"x-amzn-transcribe-vocabulary-names": input.VocabularyNames!,
"x-amzn-transcribe-vocabulary-filter-names": input.VocabularyFilterNames!,
});
Expand Down Expand Up @@ -436,6 +440,10 @@ export const de_StartStreamTranscriptionCommand = async (
],
LanguageOptions: [, output.headers["x-amzn-transcribe-language-options"]],
PreferredLanguage: [, output.headers["x-amzn-transcribe-preferred-language"]],
IdentifyMultipleLanguages: [
() => void 0 !== output.headers["x-amzn-transcribe-identify-multiple-languages"],
() => __parseBoolean(output.headers["x-amzn-transcribe-identify-multiple-languages"]),
],
VocabularyNames: [, output.headers["x-amzn-transcribe-vocabulary-names"]],
VocabularyFilterNames: [, output.headers["x-amzn-transcribe-vocabulary-filter-names"]],
});
Expand Down
20 changes: 18 additions & 2 deletions codegen/sdk-codegen/aws-models/transcribe-streaming.json
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed to \n Amazon Transcribe and the transcription results are streamed to your application.</p>\n <p>The following parameters are required:</p>\n <ul>\n <li>\n <p>\n <code>language-code</code> or <code>identify-language</code>\n </p>\n </li>\n <li>\n <p>\n <code>media-encoding</code>\n </p>\n </li>\n <li>\n <p>\n <code>sample-rate</code>\n </p>\n </li>\n </ul>\n <p>For more information on streaming with Amazon Transcribe, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html\">Transcribing streaming audio</a>.</p>",
"smithy.api#documentation": "<p>Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed to \n Amazon Transcribe and the transcription results are streamed to your application.</p>\n <p>The following parameters are required:</p>\n <ul>\n <li>\n <p>\n <code>language-code</code> or <code>identify-language</code> or <code>identify-multiple-language</code>\n </p>\n </li>\n <li>\n <p>\n <code>media-encoding</code>\n </p>\n </li>\n <li>\n <p>\n <code>sample-rate</code>\n </p>\n </li>\n </ul>\n <p>For more information on streaming with Amazon Transcribe, see <a href=\"https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html\">Transcribing streaming audio</a>.</p>",
"smithy.api#http": {
"method": "POST",
"uri": "/stream-transcription",
Expand Down Expand Up @@ -2030,7 +2030,7 @@
"target": "com.amazonaws.transcribestreaming#Boolean",
"traits": {
"smithy.api#default": false,
"smithy.api#documentation": "<p>Enables automatic language identification for your transcription.</p>\n <p>If you include <code>IdentifyLanguage</code>, you can optionally include a list of \n language codes, using <code>LanguageOptions</code>, that you think may be present in \n your audio stream. Including language options can improve transcription accuracy.</p>\n <p>You can also include a preferred language using <code>PreferredLanguage</code>. Adding a \n preferred language can help Amazon Transcribe identify the language faster than if you omit this \n parameter.</p>\n <p>If you have multi-channel audio that contains different languages on each channel, and you've \n enabled channel identification, automatic language identification identifies the dominant language on \n each audio channel.</p>\n <p>Note that you must include either <code>LanguageCode</code> or \n <code>IdentifyLanguage</code> in your request. If you include both parameters, your request\n fails.</p>\n <p>Streaming language identification can't be combined with custom language models or \n redaction.</p>",
"smithy.api#documentation": "<p>Enables automatic language identification for your transcription.</p>\n <p>If you include <code>IdentifyLanguage</code>, you can optionally include a list of \n language codes, using <code>LanguageOptions</code>, that you think may be present in \n your audio stream. Including language options can improve transcription accuracy.</p>\n <p>You can also include a preferred language using <code>PreferredLanguage</code>. Adding a \n preferred language can help Amazon Transcribe identify the language faster than if you omit this \n parameter.</p>\n <p>If you have multi-channel audio that contains different languages on each channel, and you've \n enabled channel identification, automatic language identification identifies the dominant language on \n each audio channel.</p>\n <p>Note that you must include either <code>LanguageCode</code> or \n <code>IdentifyLanguage</code> or <code>IdentifyMultipleLanguages</code> in your request. If you include more than one of these parameters, your transcription job\n fails.</p>\n <p>Streaming language identification can't be combined with custom language models or \n redaction.</p>",
"smithy.api#httpHeader": "x-amzn-transcribe-identify-language"
}
},
Expand All @@ -2048,6 +2048,14 @@
"smithy.api#httpHeader": "x-amzn-transcribe-preferred-language"
}
},
"IdentifyMultipleLanguages": {
"target": "com.amazonaws.transcribestreaming#Boolean",
"traits": {
"smithy.api#default": false,
"smithy.api#documentation": "<p>Enables automatic multi-language identification in your transcription job request. Use this parameter if your stream contains more than one language. If your stream contains only one language, use IdentifyLanguage instead.</p>\n <p>If you include <code>IdentifyMultipleLanguages</code>, you can optionally include a list of language codes, using <code>LanguageOptions</code>, that you think may be present in your stream. Including <code>LanguageOptions</code> restricts <code>IdentifyMultipleLanguages</code> to only the language options that you specify, which can improve transcription accuracy.</p>\n <p>If you want to apply a custom vocabulary or a custom vocabulary filter to your automatic multiple language identification request, include <code>VocabularyNames</code> or <code>VocabularyFilterNames</code>.</p>\n <p>Note that you must include one of <code>LanguageCode</code>, <code>IdentifyLanguage</code>, or <code>IdentifyMultipleLanguages</code> in your request. If you include more than one of these parameters, your transcription job fails.</p>",
"smithy.api#httpHeader": "x-amzn-transcribe-identify-multiple-languages"
}
},
"VocabularyNames": {
"target": "com.amazonaws.transcribestreaming#VocabularyNames",
"traits": {
Expand Down Expand Up @@ -2221,6 +2229,14 @@
"smithy.api#httpHeader": "x-amzn-transcribe-preferred-language"
}
},
"IdentifyMultipleLanguages": {
"target": "com.amazonaws.transcribestreaming#Boolean",
"traits": {
"smithy.api#default": false,
"smithy.api#documentation": "<p>Shows whether automatic multi-language identification was enabled for your transcription.</p>",
"smithy.api#httpHeader": "x-amzn-transcribe-identify-multiple-languages"
}
},
"VocabularyNames": {
"target": "com.amazonaws.transcribestreaming#VocabularyNames",
"traits": {
Expand Down

0 comments on commit 09ffb2a

Please sign in to comment.