Skip to content

Commit 1a3763c

Browse files
feat(speech): update the api
#### speech:v1 The following keys were added: - schemas.RecognitionConfig.properties.alternativeLanguageCodes (Total Keys: 2) - schemas.RecognitionConfig.properties.enableWordConfidence.type (Total Keys: 1) - schemas.SpeechRecognitionResult.properties.languageCode (Total Keys: 2) - schemas.WordInfo.properties.confidence (Total Keys: 2)
1 parent 164169f commit 1a3763c

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

docs/dyn/speech_v1.speech.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ <h3>Method Details</h3>
103103
&quot;uri&quot;: &quot;A String&quot;, # URI that points to a file that contains audio data bytes as specified in `RecognitionConfig`. The file must not be compressed (for example, gzip). Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: `gs://bucket_name/object_name` (other URI formats return google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
104104
},
105105
&quot;config&quot;: { # Provides information to the recognizer that specifies how to process the request. # Required. Provides information to the recognizer that specifies how to process the request.
106+
&quot;alternativeLanguageCodes&quot;: [ # A list of up to 3 additional [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, listing possible alternative languages of the supplied audio. See [Language Support](https://cloud.google.com/speech-to-text/docs/languages) for a list of the currently supported language codes. If alternative languages are listed, recognition result will contain recognition in the most likely language detected including the main language_code. The recognition result will include the language tag of the language detected in the audio. Note: This feature is only supported for Voice Command and Voice Search use cases and performance may vary for other use cases (e.g., phone call transcription).
107+
&quot;A String&quot;,
108+
],
106109
&quot;audioChannelCount&quot;: 42, # The number of channels in the input audio data. ONLY set this for MULTI-CHANNEL recognition. Valid values for LINEAR16 and FLAC are `1`-`8`. Valid values for OGG_OPUS are &#x27;1&#x27;-&#x27;254&#x27;. Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. If `0` or omitted, defaults to one channel (mono). Note: We only recognize the first channel by default. To perform independent recognition on each channel set `enable_separate_recognition_per_channel` to &#x27;true&#x27;.
107110
&quot;diarizationConfig&quot;: { # Config to enable speaker diarization. # Config to enable speaker diarization and set additional parameters to make diarization better suited for your application. Note: When this is enabled, we send all the words from the beginning of the audio for the top alternative in every consecutive STREAMING responses. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time. For non-streaming requests, the diarization results will be provided only in the top alternative of the FINAL SpeechRecognitionResult.
108111
&quot;enableSpeakerDiarization&quot;: True or False, # If &#x27;true&#x27;, enables speaker detection for each recognized word in the top alternative of the recognition result using a speaker_tag provided in the WordInfo.
@@ -112,6 +115,7 @@ <h3>Method Details</h3>
112115
},
113116
&quot;enableAutomaticPunctuation&quot;: True or False, # If &#x27;true&#x27;, adds punctuation to recognition result hypotheses. This feature is only available in select languages. Setting this for requests in other languages has no effect at all. The default &#x27;false&#x27; value does not add punctuation to result hypotheses.
114117
&quot;enableSeparateRecognitionPerChannel&quot;: True or False, # This needs to be set to `true` explicitly and `audio_channel_count` &gt; 1 to get each channel recognized separately. The recognition result will contain a `channel_tag` field to state which channel that result belongs to. If this is not true, we will only recognize the first channel. The request is billed cumulatively for all channels recognized: `audio_channel_count` multiplied by the length of the audio.
118+
&quot;enableWordConfidence&quot;: True or False, # If `true`, the top result includes a list of words and the confidence for those words. If `false`, no word-level confidence information is returned. The default is `false`.
115119
&quot;enableWordTimeOffsets&quot;: True or False, # If `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If `false`, no word-level time offset information is returned. The default is `false`.
116120
&quot;encoding&quot;: &quot;A String&quot;, # Encoding of audio data sent in all `RecognitionAudio` messages. This field is optional for `FLAC` and `WAV` audio files and required for all other audio formats. For details, see AudioEncoding.
117121
&quot;languageCode&quot;: &quot;A String&quot;, # Required. The language of the supplied audio as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: &quot;en-US&quot;. See [Language Support](https://cloud.google.com/speech-to-text/docs/languages) for a list of the currently supported language codes.
@@ -186,6 +190,9 @@ <h3>Method Details</h3>
186190
&quot;uri&quot;: &quot;A String&quot;, # URI that points to a file that contains audio data bytes as specified in `RecognitionConfig`. The file must not be compressed (for example, gzip). Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: `gs://bucket_name/object_name` (other URI formats return google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
187191
},
188192
&quot;config&quot;: { # Provides information to the recognizer that specifies how to process the request. # Required. Provides information to the recognizer that specifies how to process the request.
193+
&quot;alternativeLanguageCodes&quot;: [ # A list of up to 3 additional [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, listing possible alternative languages of the supplied audio. See [Language Support](https://cloud.google.com/speech-to-text/docs/languages) for a list of the currently supported language codes. If alternative languages are listed, recognition result will contain recognition in the most likely language detected including the main language_code. The recognition result will include the language tag of the language detected in the audio. Note: This feature is only supported for Voice Command and Voice Search use cases and performance may vary for other use cases (e.g., phone call transcription).
194+
&quot;A String&quot;,
195+
],
189196
&quot;audioChannelCount&quot;: 42, # The number of channels in the input audio data. ONLY set this for MULTI-CHANNEL recognition. Valid values for LINEAR16 and FLAC are `1`-`8`. Valid values for OGG_OPUS are &#x27;1&#x27;-&#x27;254&#x27;. Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. If `0` or omitted, defaults to one channel (mono). Note: We only recognize the first channel by default. To perform independent recognition on each channel set `enable_separate_recognition_per_channel` to &#x27;true&#x27;.
190197
&quot;diarizationConfig&quot;: { # Config to enable speaker diarization. # Config to enable speaker diarization and set additional parameters to make diarization better suited for your application. Note: When this is enabled, we send all the words from the beginning of the audio for the top alternative in every consecutive STREAMING responses. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time. For non-streaming requests, the diarization results will be provided only in the top alternative of the FINAL SpeechRecognitionResult.
191198
&quot;enableSpeakerDiarization&quot;: True or False, # If &#x27;true&#x27;, enables speaker detection for each recognized word in the top alternative of the recognition result using a speaker_tag provided in the WordInfo.
@@ -195,6 +202,7 @@ <h3>Method Details</h3>
195202
},
196203
&quot;enableAutomaticPunctuation&quot;: True or False, # If &#x27;true&#x27;, adds punctuation to recognition result hypotheses. This feature is only available in select languages. Setting this for requests in other languages has no effect at all. The default &#x27;false&#x27; value does not add punctuation to result hypotheses.
197204
&quot;enableSeparateRecognitionPerChannel&quot;: True or False, # This needs to be set to `true` explicitly and `audio_channel_count` &gt; 1 to get each channel recognized separately. The recognition result will contain a `channel_tag` field to state which channel that result belongs to. If this is not true, we will only recognize the first channel. The request is billed cumulatively for all channels recognized: `audio_channel_count` multiplied by the length of the audio.
205+
&quot;enableWordConfidence&quot;: True or False, # If `true`, the top result includes a list of words and the confidence for those words. If `false`, no word-level confidence information is returned. The default is `false`.
198206
&quot;enableWordTimeOffsets&quot;: True or False, # If `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If `false`, no word-level time offset information is returned. The default is `false`.
199207
&quot;encoding&quot;: &quot;A String&quot;, # Encoding of audio data sent in all `RecognitionAudio` messages. This field is optional for `FLAC` and `WAV` audio files and required for all other audio formats. For details, see AudioEncoding.
200208
&quot;languageCode&quot;: &quot;A String&quot;, # Required. The language of the supplied audio as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: &quot;en-US&quot;. See [Language Support](https://cloud.google.com/speech-to-text/docs/languages) for a list of the currently supported language codes.
@@ -240,6 +248,7 @@ <h3>Method Details</h3>
240248
&quot;transcript&quot;: &quot;A String&quot;, # Transcript text representing the words that the user spoke.
241249
&quot;words&quot;: [ # A list of word-specific information for each recognized word. Note: When `enable_speaker_diarization` is true, you will see all the words from the beginning of the audio.
242250
{ # Word-specific information for recognized words.
251+
&quot;confidence&quot;: 3.14, # The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater likelihood that the recognized words are correct. This field is set only for the top alternative of a non-streaming result or, of a streaming result where `is_final=true`. This field is not guaranteed to be accurate and users should not rely on it to be always provided. The default of 0.0 is a sentinel value indicating `confidence` was not set.
243252
&quot;endTime&quot;: &quot;A String&quot;, # Time offset relative to the beginning of the audio, and corresponding to the end of the spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis. This is an experimental feature and the accuracy of the time offset can vary.
244253
&quot;speakerTag&quot;: 42, # Output only. A distinct integer value is assigned for every speaker within the audio. This field specifies which one of those speakers was detected to have spoken this word. Value ranges from &#x27;1&#x27; to diarization_speaker_count. speaker_tag is set if enable_speaker_diarization = &#x27;true&#x27; and only in the top alternative.
245254
&quot;startTime&quot;: &quot;A String&quot;, # Time offset relative to the beginning of the audio, and corresponding to the start of the spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis. This is an experimental feature and the accuracy of the time offset can vary.
@@ -249,6 +258,7 @@ <h3>Method Details</h3>
249258
},
250259
],
251260
&quot;channelTag&quot;: 42, # For multi-channel audio, this is the channel number corresponding to the recognized result for the audio from that channel. For audio_channel_count = N, its output values can range from &#x27;1&#x27; to &#x27;N&#x27;.
261+
&quot;languageCode&quot;: &quot;A String&quot;, # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio.
252262
},
253263
],
254264
&quot;totalBilledTime&quot;: &quot;A String&quot;, # When available, billed audio seconds for the corresponding request.

googleapiclient/discovery_cache/documents/speech.v1.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
}
213213
}
214214
},
215-
"revision": "20210929",
215+
"revision": "20211008",
216216
"rootUrl": "https://speech.googleapis.com/",
217217
"schemas": {
218218
"ListOperationsResponse": {
@@ -361,6 +361,13 @@
361361
"description": "Provides information to the recognizer that specifies how to process the request.",
362362
"id": "RecognitionConfig",
363363
"properties": {
364+
"alternativeLanguageCodes": {
365+
"description": "A list of up to 3 additional [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, listing possible alternative languages of the supplied audio. See [Language Support](https://cloud.google.com/speech-to-text/docs/languages) for a list of the currently supported language codes. If alternative languages are listed, recognition result will contain recognition in the most likely language detected including the main language_code. The recognition result will include the language tag of the language detected in the audio. Note: This feature is only supported for Voice Command and Voice Search use cases and performance may vary for other use cases (e.g., phone call transcription).",
366+
"items": {
367+
"type": "string"
368+
},
369+
"type": "array"
370+
},
364371
"audioChannelCount": {
365372
"description": "The number of channels in the input audio data. ONLY set this for MULTI-CHANNEL recognition. Valid values for LINEAR16 and FLAC are `1`-`8`. Valid values for OGG_OPUS are '1'-'254'. Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. If `0` or omitted, defaults to one channel (mono). Note: We only recognize the first channel by default. To perform independent recognition on each channel set `enable_separate_recognition_per_channel` to 'true'.",
366373
"format": "int32",
@@ -378,6 +385,10 @@
378385
"description": "This needs to be set to `true` explicitly and `audio_channel_count` > 1 to get each channel recognized separately. The recognition result will contain a `channel_tag` field to state which channel that result belongs to. If this is not true, we will only recognize the first channel. The request is billed cumulatively for all channels recognized: `audio_channel_count` multiplied by the length of the audio.",
379386
"type": "boolean"
380387
},
388+
"enableWordConfidence": {
389+
"description": "If `true`, the top result includes a list of words and the confidence for those words. If `false`, no word-level confidence information is returned. The default is `false`.",
390+
"type": "boolean"
391+
},
381392
"enableWordTimeOffsets": {
382393
"description": "If `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If `false`, no word-level time offset information is returned. The default is `false`.",
383394
"type": "boolean"
@@ -663,6 +674,11 @@
663674
"description": "For multi-channel audio, this is the channel number corresponding to the recognized result for the audio from that channel. For audio_channel_count = N, its output values can range from '1' to 'N'.",
664675
"format": "int32",
665676
"type": "integer"
677+
},
678+
"languageCode": {
679+
"description": "Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio.",
680+
"readOnly": true,
681+
"type": "string"
666682
}
667683
},
668684
"type": "object"
@@ -709,6 +725,11 @@
709725
"description": "Word-specific information for recognized words.",
710726
"id": "WordInfo",
711727
"properties": {
728+
"confidence": {
729+
"description": "The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater likelihood that the recognized words are correct. This field is set only for the top alternative of a non-streaming result or, of a streaming result where `is_final=true`. This field is not guaranteed to be accurate and users should not rely on it to be always provided. The default of 0.0 is a sentinel value indicating `confidence` was not set.",
730+
"format": "float",
731+
"type": "number"
732+
},
712733
"endTime": {
713734
"description": "Time offset relative to the beginning of the audio, and corresponding to the end of the spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis. This is an experimental feature and the accuracy of the time offset can vary.",
714735
"format": "google-duration",

googleapiclient/discovery_cache/documents/speech.v1p1beta1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@
524524
}
525525
}
526526
},
527-
"revision": "20210929",
527+
"revision": "20211008",
528528
"rootUrl": "https://speech.googleapis.com/",
529529
"schemas": {
530530
"ClassItem": {

googleapiclient/discovery_cache/documents/speech.v2beta1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
}
185185
}
186186
},
187-
"revision": "20210929",
187+
"revision": "20211008",
188188
"rootUrl": "https://speech.googleapis.com/",
189189
"schemas": {
190190
"ListOperationsResponse": {

0 commit comments

Comments
 (0)