blob: fee49eb6fa2c36f7ee58733f64b4aae660f49b74 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="speech_v1p1beta1.html">Cloud Speech-to-Text API</a> . <a href="speech_v1p1beta1.speech.html">speech</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#longrunningrecognize">longrunningrecognize(body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Performs asynchronous speech recognition: receive results via the</p>
80<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#recognize">recognize(body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070082<p class="firstline">Performs synchronous speech recognition: receive results after all audio</p>
83<h3>Method Details</h3>
84<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070085 <code class="details" id="longrunningrecognize">longrunningrecognize(body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070086 <pre>Performs asynchronous speech recognition: receive results via the
87google.longrunning.Operations interface. Returns either an
88`Operation.error` or an `Operation.response` which contains
89a `LongRunningRecognizeResponse` message.
90For more information on asynchronous speech recognition, see the
91[how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
92
93Args:
Dan O'Mearadd494642020-05-01 07:42:23 -070094 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070095 The object takes the form of:
96
97{ # The top-level message sent by the client for the `LongRunningRecognize`
98 # method.
Bu Sun Kim65020912020-05-20 12:08:20 -070099 &quot;config&quot;: { # Provides information to the recognizer that specifies how to process the # Required. Provides information to the recognizer that specifies how to
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700100 # process the request.
101 # request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700102 &quot;enableWordTimeOffsets&quot;: True or False, # If `true`, the top result includes a list of words and
103 # the start and end time offsets (timestamps) for those words. If
104 # `false`, no word-level time offset information is returned. The default is
105 # `false`.
106 &quot;alternativeLanguageCodes&quot;: [ # A list of up to 3 additional
107 # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
108 # listing possible alternative languages of the supplied audio.
109 # See [Language
110 # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
111 # of the currently supported language codes. If alternative languages are
112 # listed, recognition result will contain recognition in the most likely
113 # language detected including the main language_code. The recognition result
114 # will include the language tag of the language detected in the audio. Note:
115 # This feature is only supported for Voice Command and Voice Search use cases
116 # and performance may vary for other use cases (e.g., phone call
117 # transcription).
118 &quot;A String&quot;,
119 ],
120 &quot;diarizationConfig&quot;: { # Config to enable speaker diarization. # Config to enable speaker diarization and set additional
121 # parameters to make diarization better suited for your application.
122 # Note: When this is enabled, we send all the words from the beginning of the
123 # audio for the top alternative in every consecutive STREAMING responses.
124 # This is done in order to improve our speaker tags as our models learn to
125 # identify the speakers in the conversation over time.
126 # For non-streaming requests, the diarization results will be provided only
127 # in the top alternative of the FINAL SpeechRecognitionResult.
128 &quot;enableSpeakerDiarization&quot;: True or False, # If &#x27;true&#x27;, enables speaker detection for each recognized word in
129 # the top alternative of the recognition result using a speaker_tag provided
130 # in the WordInfo.
131 &quot;minSpeakerCount&quot;: 42, # Minimum number of speakers in the conversation. This range gives you more
132 # flexibility by allowing the system to automatically determine the correct
133 # number of speakers. If not set, the default value is 2.
134 &quot;maxSpeakerCount&quot;: 42, # Maximum number of speakers in the conversation. This range gives you more
135 # flexibility by allowing the system to automatically determine the correct
136 # number of speakers. If not set, the default value is 6.
137 &quot;speakerTag&quot;: 42, # Output only. Unused.
138 },
139 &quot;languageCode&quot;: &quot;A String&quot;, # Required. The language of the supplied audio as a
140 # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
141 # Example: &quot;en-US&quot;.
142 # See [Language
143 # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
144 # of the currently supported language codes.
145 &quot;profanityFilter&quot;: True or False, # If set to `true`, the server will attempt to filter out
146 # profanities, replacing all but the initial character in each filtered word
147 # with asterisks, e.g. &quot;f***&quot;. If set to `false` or omitted, profanities
148 # won&#x27;t be filtered out.
149 &quot;enableSpeakerDiarization&quot;: True or False, # If &#x27;true&#x27;, enables speaker detection for each recognized word in
150 # the top alternative of the recognition result using a speaker_tag provided
151 # in the WordInfo.
152 # Note: Use diarization_config instead.
153 &quot;useEnhanced&quot;: True or False, # Set to true to use an enhanced model for speech recognition.
154 # If `use_enhanced` is set to true and the `model` field is not set, then
155 # an appropriate enhanced model is chosen if an enhanced model exists for
156 # the audio.
157 #
158 # If `use_enhanced` is true and an enhanced version of the specified model
159 # does not exist, then the speech is recognized using the standard version
160 # of the specified model.
Bu Sun Kim65020912020-05-20 12:08:20 -0700161 &quot;metadata&quot;: { # Description of audio data to be recognized. # Metadata regarding this request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700162 &quot;microphoneDistance&quot;: &quot;A String&quot;, # The audio type that most closely describes the audio being recognized.
163 &quot;industryNaicsCodeOfAudio&quot;: 42, # The industry vertical to which this speech recognition request most
164 # closely applies. This is most indicative of the topics contained
165 # in the audio. Use the 6-digit NAICS code to identify the industry
166 # vertical - see https://www.naics.com/search/.
Bu Sun Kim65020912020-05-20 12:08:20 -0700167 &quot;originalMediaType&quot;: &quot;A String&quot;, # The original media the speech was recorded on.
168 &quot;obfuscatedId&quot;: &quot;A String&quot;, # Obfuscated (privacy-protected) ID of the user, to identify number of
169 # unique users using the service.
170 &quot;recordingDeviceType&quot;: &quot;A String&quot;, # The type of device the speech was recorded with.
171 &quot;interactionType&quot;: &quot;A String&quot;, # The use case most closely describing the audio content to be recognized.
172 &quot;recordingDeviceName&quot;: &quot;A String&quot;, # The device used to make the recording. Examples &#x27;Nexus 5X&#x27; or
173 # &#x27;Polycom SoundStation IP 6000&#x27; or &#x27;POTS&#x27; or &#x27;VoIP&#x27; or
174 # &#x27;Cardioid Microphone&#x27;.
175 &quot;originalMimeType&quot;: &quot;A String&quot;, # Mime type of the original audio file. For example `audio/m4a`,
176 # `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
177 # A list of possible audio mime types is maintained at
178 # http://www.iana.org/assignments/media-types/media-types.xhtml#audio
179 &quot;audioTopic&quot;: &quot;A String&quot;, # Description of the content. Eg. &quot;Recordings of federal supreme court
180 # hearings from 2012&quot;.
Bu Sun Kim65020912020-05-20 12:08:20 -0700181 },
182 &quot;sampleRateHertz&quot;: 42, # Sample rate in Hertz of the audio data sent in all
183 # `RecognitionAudio` messages. Valid values are: 8000-48000.
184 # 16000 is optimal. For best results, set the sampling rate of the audio
185 # source to 16000 Hz. If that&#x27;s not possible, use the native sample rate of
186 # the audio source (instead of re-sampling).
187 # This field is optional for FLAC and WAV audio files, but is
188 # required for all other audio formats. For details, see AudioEncoding.
189 &quot;enableSeparateRecognitionPerChannel&quot;: True or False, # This needs to be set to `true` explicitly and `audio_channel_count` &gt; 1
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700190 # to get each channel recognized separately. The recognition result will
191 # contain a `channel_tag` field to state which channel that result belongs
192 # to. If this is not true, we will only recognize the first channel. The
193 # request is billed cumulatively for all channels recognized:
194 # `audio_channel_count` multiplied by the length of the audio.
Bu Sun Kim65020912020-05-20 12:08:20 -0700195 &quot;enableAutomaticPunctuation&quot;: True or False, # If &#x27;true&#x27;, adds punctuation to recognition result hypotheses.
196 # This feature is only available in select languages. Setting this for
197 # requests in other languages has no effect at all.
198 # The default &#x27;false&#x27; value does not add punctuation to result hypotheses.
199 &quot;adaptation&quot;: { # Speech adaptation configuration. # Speech adaptation configuration improves the accuracy of speech
Dan O'Mearadd494642020-05-01 07:42:23 -0700200 # recognition. When speech adaptation is set it supersedes the
201 # `speech_contexts` field. For more information, see the [speech
202 # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
203 # documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700204 &quot;phraseSets&quot;: [ # A collection of phrase sets. To specify the hints inline, leave the
205 # phrase set&#x27;s `name` blank and fill in the rest of its fields. Any
Dan O'Mearadd494642020-05-01 07:42:23 -0700206 # phrase set can use any custom class.
Bu Sun Kim65020912020-05-20 12:08:20 -0700207 { # Provides &quot;hints&quot; to the speech recognizer to favor specific words and phrases
Dan O'Mearadd494642020-05-01 07:42:23 -0700208 # in the results.
Bu Sun Kim65020912020-05-20 12:08:20 -0700209 &quot;name&quot;: &quot;A String&quot;, # The resource name of the phrase set.
210 &quot;phrases&quot;: [ # A list of word and phrases.
211 { # A phrases containing words and phrase &quot;hints&quot; so that
Dan O'Mearadd494642020-05-01 07:42:23 -0700212 # the speech recognition is more likely to recognize them. This can be used
213 # to improve the accuracy for specific words and phrases, for example, if
214 # specific commands are typically spoken by the user. This can also be used
215 # to add additional words to the vocabulary of the recognizer. See
216 # [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
217 #
218 # List items can also include pre-built or custom classes containing groups
219 # of words that represent common concepts that occur in natural language. For
220 # example, rather than providing a phrase hint for every month of the
Bu Sun Kim65020912020-05-20 12:08:20 -0700221 # year (e.g. &quot;i was born in january&quot;, &quot;i was born in febuary&quot;, ...), use the
222 # pre-built `$MONTH` class improves the likelihood of correctly transcribing
223 # audio that includes months (e.g. &quot;i was born in $month&quot;).
224 # To refer to pre-built classes, use the class&#x27; symbol prepended with `$`
225 # e.g. `$MONTH`. To refer to custom classes that were defined inline in the
226 # request, set the class&#x27;s `custom_class_id` to a string unique to all class
227 # resources and inline classes. Then use the class&#x27; id wrapped in $`{...}`
228 # e.g. &quot;${my-months}&quot;. To refer to custom classes resources, use the class&#x27;
229 # id wrapped in `${}` (e.g. `${my-months}`).
Bu Sun Kim65020912020-05-20 12:08:20 -0700230 &quot;boost&quot;: 3.14, # Hint Boost. Overrides the boost set at the phrase set level.
Dan O'Mearadd494642020-05-01 07:42:23 -0700231 # Positive value will increase the probability that a specific phrase will
232 # be recognized over other similar sounding phrases. The higher the boost,
233 # the higher the chance of false positive recognition as well. Negative
234 # boost values would correspond to anti-biasing. Anti-biasing is not
235 # enabled, so negative boost will simply be ignored. Though `boost` can
236 # accept a wide range of positive values, most use cases are best served
237 # with values between 0 and 20. We recommend using a binary search approach
238 # to finding the optimal value for your use case. Speech recognition
239 # will skip PhraseSets with a boost value of 0.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700240 &quot;value&quot;: &quot;A String&quot;, # The phrase itself.
Dan O'Mearadd494642020-05-01 07:42:23 -0700241 },
242 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700243 &quot;boost&quot;: 3.14, # Hint Boost. Positive value will increase the probability that a specific
244 # phrase will be recognized over other similar sounding phrases. The higher
245 # the boost, the higher the chance of false positive recognition as well.
246 # Negative boost values would correspond to anti-biasing. Anti-biasing is not
247 # enabled, so negative boost will simply be ignored. Though `boost` can
248 # accept a wide range of positive values, most use cases are best served with
249 # values between 0 (exclusive) and 20. We recommend using a binary search
250 # approach to finding the optimal value for your use case. Speech recognition
251 # will skip PhraseSets with a boost value of 0.
Dan O'Mearadd494642020-05-01 07:42:23 -0700252 },
253 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700254 &quot;customClasses&quot;: [ # A collection of custom classes. To specify the classes inline, leave the
255 # class&#x27; `name` blank and fill in the rest of its fields, giving it a unique
Dan O'Mearadd494642020-05-01 07:42:23 -0700256 # `custom_class_id`. Refer to the inline defined class in phrase hints by its
257 # `custom_class_id`.
258 { # A set of words or phrases that represents a common concept likely to appear
259 # in your audio, for example a list of passenger ship names. CustomClass items
260 # can be substituted into placeholders that you set in PhraseSet phrases.
Bu Sun Kim65020912020-05-20 12:08:20 -0700261 &quot;items&quot;: [ # A collection of class items.
Dan O'Mearadd494642020-05-01 07:42:23 -0700262 { # An item of the class.
Bu Sun Kim65020912020-05-20 12:08:20 -0700263 &quot;value&quot;: &quot;A String&quot;, # The class item&#x27;s value.
Dan O'Mearadd494642020-05-01 07:42:23 -0700264 },
265 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700266 &quot;name&quot;: &quot;A String&quot;, # The resource name of the custom class.
267 &quot;customClassId&quot;: &quot;A String&quot;, # If this custom class is a resource, the custom_class_id is the resource id
268 # of the CustomClass. Case sensitive.
Dan O'Mearadd494642020-05-01 07:42:23 -0700269 },
270 ],
271 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700272 &quot;diarizationSpeakerCount&quot;: 42, # If set, specifies the estimated number of speakers in the conversation.
273 # Defaults to &#x27;2&#x27;. Ignored unless enable_speaker_diarization is set to true.
274 # Note: Use diarization_config instead.
Bu Sun Kim65020912020-05-20 12:08:20 -0700275 &quot;maxAlternatives&quot;: 42, # Maximum number of recognition hypotheses to be returned.
276 # Specifically, the maximum number of `SpeechRecognitionAlternative` messages
277 # within each `SpeechRecognitionResult`.
278 # The server may return fewer than `max_alternatives`.
279 # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
280 # one. If omitted, will return a maximum of one.
Bu Sun Kim65020912020-05-20 12:08:20 -0700281 &quot;speechContexts&quot;: [ # Array of SpeechContext.
282 # A means to provide context to assist the speech recognition. For more
283 # information, see
284 # [speech
285 # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
286 { # Provides &quot;hints&quot; to the speech recognizer to favor specific words and phrases
287 # in the results.
288 &quot;phrases&quot;: [ # A list of strings containing words and phrases &quot;hints&quot; so that
289 # the speech recognition is more likely to recognize them. This can be used
290 # to improve the accuracy for specific words and phrases, for example, if
291 # specific commands are typically spoken by the user. This can also be used
292 # to add additional words to the vocabulary of the recognizer. See
293 # [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
294 #
295 # List items can also be set to classes for groups of words that represent
296 # common concepts that occur in natural language. For example, rather than
297 # providing phrase hints for every month of the year, using the $MONTH class
298 # improves the likelihood of correctly transcribing audio that includes
299 # months.
300 &quot;A String&quot;,
301 ],
302 &quot;boost&quot;: 3.14, # Hint Boost. Positive value will increase the probability that a specific
303 # phrase will be recognized over other similar sounding phrases. The higher
304 # the boost, the higher the chance of false positive recognition as well.
305 # Negative boost values would correspond to anti-biasing. Anti-biasing is not
306 # enabled, so negative boost will simply be ignored. Though `boost` can
307 # accept a wide range of positive values, most use cases are best served with
308 # values between 0 and 20. We recommend using a binary search approach to
309 # finding the optimal value for your use case.
310 },
311 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700312 &quot;encoding&quot;: &quot;A String&quot;, # Encoding of audio data sent in all `RecognitionAudio` messages.
313 # This field is optional for `FLAC` and `WAV` audio files and required
314 # for all other audio formats. For details, see AudioEncoding.
Bu Sun Kim65020912020-05-20 12:08:20 -0700315 &quot;enableWordConfidence&quot;: True or False, # If `true`, the top result includes a list of words and the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700316 # confidence for those words. If `false`, no word-level confidence
317 # information is returned. The default is `false`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700318 &quot;model&quot;: &quot;A String&quot;, # Which model to select for the given request. Select the model
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700319 # best suited to your domain to get best results. If a model is not
320 # explicitly specified, then we auto-select a model based on the parameters
321 # in the RecognitionConfig.
Dan O'Mearadd494642020-05-01 07:42:23 -0700322 # &lt;table&gt;
323 # &lt;tr&gt;
324 # &lt;td&gt;&lt;b&gt;Model&lt;/b&gt;&lt;/td&gt;
325 # &lt;td&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/td&gt;
326 # &lt;/tr&gt;
327 # &lt;tr&gt;
328 # &lt;td&gt;&lt;code&gt;command_and_search&lt;/code&gt;&lt;/td&gt;
329 # &lt;td&gt;Best for short queries such as voice commands or voice search.&lt;/td&gt;
330 # &lt;/tr&gt;
331 # &lt;tr&gt;
332 # &lt;td&gt;&lt;code&gt;phone_call&lt;/code&gt;&lt;/td&gt;
333 # &lt;td&gt;Best for audio that originated from a phone call (typically
334 # recorded at an 8khz sampling rate).&lt;/td&gt;
335 # &lt;/tr&gt;
336 # &lt;tr&gt;
337 # &lt;td&gt;&lt;code&gt;video&lt;/code&gt;&lt;/td&gt;
338 # &lt;td&gt;Best for audio that originated from from video or includes multiple
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700339 # speakers. Ideally the audio is recorded at a 16khz or greater
340 # sampling rate. This is a premium model that costs more than the
Dan O'Mearadd494642020-05-01 07:42:23 -0700341 # standard rate.&lt;/td&gt;
342 # &lt;/tr&gt;
343 # &lt;tr&gt;
344 # &lt;td&gt;&lt;code&gt;default&lt;/code&gt;&lt;/td&gt;
345 # &lt;td&gt;Best for audio that is not one of the specific audio models.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700346 # For example, long-form audio. Ideally the audio is high-fidelity,
Dan O'Mearadd494642020-05-01 07:42:23 -0700347 # recorded at a 16khz or greater sampling rate.&lt;/td&gt;
348 # &lt;/tr&gt;
349 # &lt;/table&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -0700350 &quot;audioChannelCount&quot;: 42, # The number of channels in the input audio data.
351 # ONLY set this for MULTI-CHANNEL recognition.
352 # Valid values for LINEAR16 and FLAC are `1`-`8`.
353 # Valid values for OGG_OPUS are &#x27;1&#x27;-&#x27;254&#x27;.
354 # Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
355 # If `0` or omitted, defaults to one channel (mono).
356 # Note: We only recognize the first channel by default.
357 # To perform independent recognition on each channel set
358 # `enable_separate_recognition_per_channel` to &#x27;true&#x27;.
Bu Sun Kim65020912020-05-20 12:08:20 -0700359 },
360 &quot;audio&quot;: { # Contains audio data in the encoding specified in the `RecognitionConfig`. # Required. The audio data to be recognized.
361 # Either `content` or `uri` must be supplied. Supplying both or neither
362 # returns google.rpc.Code.INVALID_ARGUMENT. See
363 # [content limits](https://cloud.google.com/speech-to-text/quotas#content).
364 &quot;content&quot;: &quot;A String&quot;, # The audio data bytes encoded as specified in
365 # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
366 # pure binary representation, whereas JSON representations use base64.
367 &quot;uri&quot;: &quot;A String&quot;, # URI that points to a file that contains audio data bytes as specified in
368 # `RecognitionConfig`. The file must not be compressed (for example, gzip).
369 # Currently, only Google Cloud Storage URIs are
370 # supported, which must be specified in the following format:
371 # `gs://bucket_name/object_name` (other URI formats return
372 # google.rpc.Code.INVALID_ARGUMENT). For more information, see
373 # [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700374 },
375 }
376
377 x__xgafv: string, V1 error format.
378 Allowed values
379 1 - v1 error format
380 2 - v2 error format
381
382Returns:
383 An object of the form:
384
385 { # This resource represents a long-running operation that is the result of a
386 # network API call.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700387 &quot;response&quot;: { # The normal response of the operation in case of success. If the original
388 # method returns no data on success, such as `Delete`, the response is
389 # `google.protobuf.Empty`. If the original method is standard
390 # `Get`/`Create`/`Update`, the response should be the resource. For other
391 # methods, the response should have the type `XxxResponse`, where `Xxx`
392 # is the original method name. For example, if the original method name
393 # is `TakeSnapshot()`, the inferred response type is
394 # `TakeSnapshotResponse`.
395 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
396 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700397 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
398 # originally returns it. If you use the default HTTP mapping, the
399 # `name` should be a resource name ending with `operations/{unique_id}`.
400 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700401 # different programming environments, including REST APIs and RPC APIs. It is
402 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
403 # three pieces of data: error code, error message, and error details.
404 #
405 # You can find out more about this error model and how to work with it in the
406 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim65020912020-05-20 12:08:20 -0700407 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
408 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700409 # user-facing error message should be localized and sent in the
410 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -0700411 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700412 # message types for APIs to use.
413 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700414 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700415 },
416 ],
417 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700418 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically
419 # contains progress information and common metadata such as create time.
420 # Some services might not provide such metadata. Any method that returns a
421 # long-running operation should document the metadata type, if any.
422 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
423 },
424 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700425 # If `true`, the operation is completed, and either `error` or `response` is
426 # available.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700427 }</pre>
428</div>
429
430<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700431 <code class="details" id="recognize">recognize(body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700432 <pre>Performs synchronous speech recognition: receive results after all audio
433has been sent and processed.
434
435Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700436 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700437 The object takes the form of:
438
439{ # The top-level message sent by the client for the `Recognize` method.
Bu Sun Kim65020912020-05-20 12:08:20 -0700440 &quot;config&quot;: { # Provides information to the recognizer that specifies how to process the # Required. Provides information to the recognizer that specifies how to
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700441 # process the request.
442 # request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700443 &quot;enableWordTimeOffsets&quot;: True or False, # If `true`, the top result includes a list of words and
444 # the start and end time offsets (timestamps) for those words. If
445 # `false`, no word-level time offset information is returned. The default is
446 # `false`.
447 &quot;alternativeLanguageCodes&quot;: [ # A list of up to 3 additional
448 # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
449 # listing possible alternative languages of the supplied audio.
450 # See [Language
451 # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
452 # of the currently supported language codes. If alternative languages are
453 # listed, recognition result will contain recognition in the most likely
454 # language detected including the main language_code. The recognition result
455 # will include the language tag of the language detected in the audio. Note:
456 # This feature is only supported for Voice Command and Voice Search use cases
457 # and performance may vary for other use cases (e.g., phone call
458 # transcription).
459 &quot;A String&quot;,
460 ],
461 &quot;diarizationConfig&quot;: { # Config to enable speaker diarization. # Config to enable speaker diarization and set additional
462 # parameters to make diarization better suited for your application.
463 # Note: When this is enabled, we send all the words from the beginning of the
464 # audio for the top alternative in every consecutive STREAMING responses.
465 # This is done in order to improve our speaker tags as our models learn to
466 # identify the speakers in the conversation over time.
467 # For non-streaming requests, the diarization results will be provided only
468 # in the top alternative of the FINAL SpeechRecognitionResult.
469 &quot;enableSpeakerDiarization&quot;: True or False, # If &#x27;true&#x27;, enables speaker detection for each recognized word in
470 # the top alternative of the recognition result using a speaker_tag provided
471 # in the WordInfo.
472 &quot;minSpeakerCount&quot;: 42, # Minimum number of speakers in the conversation. This range gives you more
473 # flexibility by allowing the system to automatically determine the correct
474 # number of speakers. If not set, the default value is 2.
475 &quot;maxSpeakerCount&quot;: 42, # Maximum number of speakers in the conversation. This range gives you more
476 # flexibility by allowing the system to automatically determine the correct
477 # number of speakers. If not set, the default value is 6.
478 &quot;speakerTag&quot;: 42, # Output only. Unused.
479 },
480 &quot;languageCode&quot;: &quot;A String&quot;, # Required. The language of the supplied audio as a
481 # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
482 # Example: &quot;en-US&quot;.
483 # See [Language
484 # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
485 # of the currently supported language codes.
486 &quot;profanityFilter&quot;: True or False, # If set to `true`, the server will attempt to filter out
487 # profanities, replacing all but the initial character in each filtered word
488 # with asterisks, e.g. &quot;f***&quot;. If set to `false` or omitted, profanities
489 # won&#x27;t be filtered out.
490 &quot;enableSpeakerDiarization&quot;: True or False, # If &#x27;true&#x27;, enables speaker detection for each recognized word in
491 # the top alternative of the recognition result using a speaker_tag provided
492 # in the WordInfo.
493 # Note: Use diarization_config instead.
494 &quot;useEnhanced&quot;: True or False, # Set to true to use an enhanced model for speech recognition.
495 # If `use_enhanced` is set to true and the `model` field is not set, then
496 # an appropriate enhanced model is chosen if an enhanced model exists for
497 # the audio.
498 #
499 # If `use_enhanced` is true and an enhanced version of the specified model
500 # does not exist, then the speech is recognized using the standard version
501 # of the specified model.
Bu Sun Kim65020912020-05-20 12:08:20 -0700502 &quot;metadata&quot;: { # Description of audio data to be recognized. # Metadata regarding this request.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700503 &quot;microphoneDistance&quot;: &quot;A String&quot;, # The audio type that most closely describes the audio being recognized.
504 &quot;industryNaicsCodeOfAudio&quot;: 42, # The industry vertical to which this speech recognition request most
505 # closely applies. This is most indicative of the topics contained
506 # in the audio. Use the 6-digit NAICS code to identify the industry
507 # vertical - see https://www.naics.com/search/.
Bu Sun Kim65020912020-05-20 12:08:20 -0700508 &quot;originalMediaType&quot;: &quot;A String&quot;, # The original media the speech was recorded on.
509 &quot;obfuscatedId&quot;: &quot;A String&quot;, # Obfuscated (privacy-protected) ID of the user, to identify number of
510 # unique users using the service.
511 &quot;recordingDeviceType&quot;: &quot;A String&quot;, # The type of device the speech was recorded with.
512 &quot;interactionType&quot;: &quot;A String&quot;, # The use case most closely describing the audio content to be recognized.
513 &quot;recordingDeviceName&quot;: &quot;A String&quot;, # The device used to make the recording. Examples &#x27;Nexus 5X&#x27; or
514 # &#x27;Polycom SoundStation IP 6000&#x27; or &#x27;POTS&#x27; or &#x27;VoIP&#x27; or
515 # &#x27;Cardioid Microphone&#x27;.
516 &quot;originalMimeType&quot;: &quot;A String&quot;, # Mime type of the original audio file. For example `audio/m4a`,
517 # `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
518 # A list of possible audio mime types is maintained at
519 # http://www.iana.org/assignments/media-types/media-types.xhtml#audio
520 &quot;audioTopic&quot;: &quot;A String&quot;, # Description of the content. Eg. &quot;Recordings of federal supreme court
521 # hearings from 2012&quot;.
Bu Sun Kim65020912020-05-20 12:08:20 -0700522 },
523 &quot;sampleRateHertz&quot;: 42, # Sample rate in Hertz of the audio data sent in all
524 # `RecognitionAudio` messages. Valid values are: 8000-48000.
525 # 16000 is optimal. For best results, set the sampling rate of the audio
526 # source to 16000 Hz. If that&#x27;s not possible, use the native sample rate of
527 # the audio source (instead of re-sampling).
528 # This field is optional for FLAC and WAV audio files, but is
529 # required for all other audio formats. For details, see AudioEncoding.
530 &quot;enableSeparateRecognitionPerChannel&quot;: True or False, # This needs to be set to `true` explicitly and `audio_channel_count` &gt; 1
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700531 # to get each channel recognized separately. The recognition result will
532 # contain a `channel_tag` field to state which channel that result belongs
533 # to. If this is not true, we will only recognize the first channel. The
534 # request is billed cumulatively for all channels recognized:
535 # `audio_channel_count` multiplied by the length of the audio.
Bu Sun Kim65020912020-05-20 12:08:20 -0700536 &quot;enableAutomaticPunctuation&quot;: True or False, # If &#x27;true&#x27;, adds punctuation to recognition result hypotheses.
537 # This feature is only available in select languages. Setting this for
538 # requests in other languages has no effect at all.
539 # The default &#x27;false&#x27; value does not add punctuation to result hypotheses.
540 &quot;adaptation&quot;: { # Speech adaptation configuration. # Speech adaptation configuration improves the accuracy of speech
Dan O'Mearadd494642020-05-01 07:42:23 -0700541 # recognition. When speech adaptation is set it supersedes the
542 # `speech_contexts` field. For more information, see the [speech
543 # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
544 # documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700545 &quot;phraseSets&quot;: [ # A collection of phrase sets. To specify the hints inline, leave the
546 # phrase set&#x27;s `name` blank and fill in the rest of its fields. Any
Dan O'Mearadd494642020-05-01 07:42:23 -0700547 # phrase set can use any custom class.
Bu Sun Kim65020912020-05-20 12:08:20 -0700548 { # Provides &quot;hints&quot; to the speech recognizer to favor specific words and phrases
Dan O'Mearadd494642020-05-01 07:42:23 -0700549 # in the results.
Bu Sun Kim65020912020-05-20 12:08:20 -0700550 &quot;name&quot;: &quot;A String&quot;, # The resource name of the phrase set.
551 &quot;phrases&quot;: [ # A list of word and phrases.
552 { # A phrases containing words and phrase &quot;hints&quot; so that
Dan O'Mearadd494642020-05-01 07:42:23 -0700553 # the speech recognition is more likely to recognize them. This can be used
554 # to improve the accuracy for specific words and phrases, for example, if
555 # specific commands are typically spoken by the user. This can also be used
556 # to add additional words to the vocabulary of the recognizer. See
557 # [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
558 #
559 # List items can also include pre-built or custom classes containing groups
560 # of words that represent common concepts that occur in natural language. For
561 # example, rather than providing a phrase hint for every month of the
Bu Sun Kim65020912020-05-20 12:08:20 -0700562 # year (e.g. &quot;i was born in january&quot;, &quot;i was born in febuary&quot;, ...), use the
563 # pre-built `$MONTH` class improves the likelihood of correctly transcribing
564 # audio that includes months (e.g. &quot;i was born in $month&quot;).
565 # To refer to pre-built classes, use the class&#x27; symbol prepended with `$`
566 # e.g. `$MONTH`. To refer to custom classes that were defined inline in the
567 # request, set the class&#x27;s `custom_class_id` to a string unique to all class
568 # resources and inline classes. Then use the class&#x27; id wrapped in $`{...}`
569 # e.g. &quot;${my-months}&quot;. To refer to custom classes resources, use the class&#x27;
570 # id wrapped in `${}` (e.g. `${my-months}`).
Bu Sun Kim65020912020-05-20 12:08:20 -0700571 &quot;boost&quot;: 3.14, # Hint Boost. Overrides the boost set at the phrase set level.
Dan O'Mearadd494642020-05-01 07:42:23 -0700572 # Positive value will increase the probability that a specific phrase will
573 # be recognized over other similar sounding phrases. The higher the boost,
574 # the higher the chance of false positive recognition as well. Negative
575 # boost values would correspond to anti-biasing. Anti-biasing is not
576 # enabled, so negative boost will simply be ignored. Though `boost` can
577 # accept a wide range of positive values, most use cases are best served
578 # with values between 0 and 20. We recommend using a binary search approach
579 # to finding the optimal value for your use case. Speech recognition
580 # will skip PhraseSets with a boost value of 0.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700581 &quot;value&quot;: &quot;A String&quot;, # The phrase itself.
Dan O'Mearadd494642020-05-01 07:42:23 -0700582 },
583 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700584 &quot;boost&quot;: 3.14, # Hint Boost. Positive value will increase the probability that a specific
585 # phrase will be recognized over other similar sounding phrases. The higher
586 # the boost, the higher the chance of false positive recognition as well.
587 # Negative boost values would correspond to anti-biasing. Anti-biasing is not
588 # enabled, so negative boost will simply be ignored. Though `boost` can
589 # accept a wide range of positive values, most use cases are best served with
590 # values between 0 (exclusive) and 20. We recommend using a binary search
591 # approach to finding the optimal value for your use case. Speech recognition
592 # will skip PhraseSets with a boost value of 0.
Dan O'Mearadd494642020-05-01 07:42:23 -0700593 },
594 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700595 &quot;customClasses&quot;: [ # A collection of custom classes. To specify the classes inline, leave the
596 # class&#x27; `name` blank and fill in the rest of its fields, giving it a unique
Dan O'Mearadd494642020-05-01 07:42:23 -0700597 # `custom_class_id`. Refer to the inline defined class in phrase hints by its
598 # `custom_class_id`.
599 { # A set of words or phrases that represents a common concept likely to appear
600 # in your audio, for example a list of passenger ship names. CustomClass items
601 # can be substituted into placeholders that you set in PhraseSet phrases.
Bu Sun Kim65020912020-05-20 12:08:20 -0700602 &quot;items&quot;: [ # A collection of class items.
Dan O'Mearadd494642020-05-01 07:42:23 -0700603 { # An item of the class.
Bu Sun Kim65020912020-05-20 12:08:20 -0700604 &quot;value&quot;: &quot;A String&quot;, # The class item&#x27;s value.
Dan O'Mearadd494642020-05-01 07:42:23 -0700605 },
606 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700607 &quot;name&quot;: &quot;A String&quot;, # The resource name of the custom class.
608 &quot;customClassId&quot;: &quot;A String&quot;, # If this custom class is a resource, the custom_class_id is the resource id
609 # of the CustomClass. Case sensitive.
Dan O'Mearadd494642020-05-01 07:42:23 -0700610 },
611 ],
612 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700613 &quot;diarizationSpeakerCount&quot;: 42, # If set, specifies the estimated number of speakers in the conversation.
614 # Defaults to &#x27;2&#x27;. Ignored unless enable_speaker_diarization is set to true.
615 # Note: Use diarization_config instead.
Bu Sun Kim65020912020-05-20 12:08:20 -0700616 &quot;maxAlternatives&quot;: 42, # Maximum number of recognition hypotheses to be returned.
617 # Specifically, the maximum number of `SpeechRecognitionAlternative` messages
618 # within each `SpeechRecognitionResult`.
619 # The server may return fewer than `max_alternatives`.
620 # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
621 # one. If omitted, will return a maximum of one.
Bu Sun Kim65020912020-05-20 12:08:20 -0700622 &quot;speechContexts&quot;: [ # Array of SpeechContext.
623 # A means to provide context to assist the speech recognition. For more
624 # information, see
625 # [speech
626 # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
627 { # Provides &quot;hints&quot; to the speech recognizer to favor specific words and phrases
628 # in the results.
629 &quot;phrases&quot;: [ # A list of strings containing words and phrases &quot;hints&quot; so that
630 # the speech recognition is more likely to recognize them. This can be used
631 # to improve the accuracy for specific words and phrases, for example, if
632 # specific commands are typically spoken by the user. This can also be used
633 # to add additional words to the vocabulary of the recognizer. See
634 # [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
635 #
636 # List items can also be set to classes for groups of words that represent
637 # common concepts that occur in natural language. For example, rather than
638 # providing phrase hints for every month of the year, using the $MONTH class
639 # improves the likelihood of correctly transcribing audio that includes
640 # months.
641 &quot;A String&quot;,
642 ],
643 &quot;boost&quot;: 3.14, # Hint Boost. Positive value will increase the probability that a specific
644 # phrase will be recognized over other similar sounding phrases. The higher
645 # the boost, the higher the chance of false positive recognition as well.
646 # Negative boost values would correspond to anti-biasing. Anti-biasing is not
647 # enabled, so negative boost will simply be ignored. Though `boost` can
648 # accept a wide range of positive values, most use cases are best served with
649 # values between 0 and 20. We recommend using a binary search approach to
650 # finding the optimal value for your use case.
651 },
652 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700653 &quot;encoding&quot;: &quot;A String&quot;, # Encoding of audio data sent in all `RecognitionAudio` messages.
654 # This field is optional for `FLAC` and `WAV` audio files and required
655 # for all other audio formats. For details, see AudioEncoding.
Bu Sun Kim65020912020-05-20 12:08:20 -0700656 &quot;enableWordConfidence&quot;: True or False, # If `true`, the top result includes a list of words and the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700657 # confidence for those words. If `false`, no word-level confidence
658 # information is returned. The default is `false`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700659 &quot;model&quot;: &quot;A String&quot;, # Which model to select for the given request. Select the model
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700660 # best suited to your domain to get best results. If a model is not
661 # explicitly specified, then we auto-select a model based on the parameters
662 # in the RecognitionConfig.
Dan O'Mearadd494642020-05-01 07:42:23 -0700663 # &lt;table&gt;
664 # &lt;tr&gt;
665 # &lt;td&gt;&lt;b&gt;Model&lt;/b&gt;&lt;/td&gt;
666 # &lt;td&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/td&gt;
667 # &lt;/tr&gt;
668 # &lt;tr&gt;
669 # &lt;td&gt;&lt;code&gt;command_and_search&lt;/code&gt;&lt;/td&gt;
670 # &lt;td&gt;Best for short queries such as voice commands or voice search.&lt;/td&gt;
671 # &lt;/tr&gt;
672 # &lt;tr&gt;
673 # &lt;td&gt;&lt;code&gt;phone_call&lt;/code&gt;&lt;/td&gt;
674 # &lt;td&gt;Best for audio that originated from a phone call (typically
675 # recorded at an 8khz sampling rate).&lt;/td&gt;
676 # &lt;/tr&gt;
677 # &lt;tr&gt;
678 # &lt;td&gt;&lt;code&gt;video&lt;/code&gt;&lt;/td&gt;
679 # &lt;td&gt;Best for audio that originated from from video or includes multiple
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700680 # speakers. Ideally the audio is recorded at a 16khz or greater
681 # sampling rate. This is a premium model that costs more than the
Dan O'Mearadd494642020-05-01 07:42:23 -0700682 # standard rate.&lt;/td&gt;
683 # &lt;/tr&gt;
684 # &lt;tr&gt;
685 # &lt;td&gt;&lt;code&gt;default&lt;/code&gt;&lt;/td&gt;
686 # &lt;td&gt;Best for audio that is not one of the specific audio models.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700687 # For example, long-form audio. Ideally the audio is high-fidelity,
Dan O'Mearadd494642020-05-01 07:42:23 -0700688 # recorded at a 16khz or greater sampling rate.&lt;/td&gt;
689 # &lt;/tr&gt;
690 # &lt;/table&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -0700691 &quot;audioChannelCount&quot;: 42, # The number of channels in the input audio data.
692 # ONLY set this for MULTI-CHANNEL recognition.
693 # Valid values for LINEAR16 and FLAC are `1`-`8`.
694 # Valid values for OGG_OPUS are &#x27;1&#x27;-&#x27;254&#x27;.
695 # Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
696 # If `0` or omitted, defaults to one channel (mono).
697 # Note: We only recognize the first channel by default.
698 # To perform independent recognition on each channel set
699 # `enable_separate_recognition_per_channel` to &#x27;true&#x27;.
Bu Sun Kim65020912020-05-20 12:08:20 -0700700 },
701 &quot;audio&quot;: { # Contains audio data in the encoding specified in the `RecognitionConfig`. # Required. The audio data to be recognized.
702 # Either `content` or `uri` must be supplied. Supplying both or neither
703 # returns google.rpc.Code.INVALID_ARGUMENT. See
704 # [content limits](https://cloud.google.com/speech-to-text/quotas#content).
705 &quot;content&quot;: &quot;A String&quot;, # The audio data bytes encoded as specified in
706 # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
707 # pure binary representation, whereas JSON representations use base64.
708 &quot;uri&quot;: &quot;A String&quot;, # URI that points to a file that contains audio data bytes as specified in
709 # `RecognitionConfig`. The file must not be compressed (for example, gzip).
710 # Currently, only Google Cloud Storage URIs are
711 # supported, which must be specified in the following format:
712 # `gs://bucket_name/object_name` (other URI formats return
713 # google.rpc.Code.INVALID_ARGUMENT). For more information, see
714 # [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700715 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700716 }
717
718 x__xgafv: string, V1 error format.
719 Allowed values
720 1 - v1 error format
721 2 - v2 error format
722
723Returns:
724 An object of the form:
725
726 { # The only message returned to the client by the `Recognize` method. It
727 # contains the result as zero or more sequential `SpeechRecognitionResult`
728 # messages.
Bu Sun Kim65020912020-05-20 12:08:20 -0700729 &quot;results&quot;: [ # Sequential list of transcription results corresponding to
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700730 # sequential portions of audio.
731 { # A speech recognition result corresponding to a portion of the audio.
Bu Sun Kim65020912020-05-20 12:08:20 -0700732 &quot;channelTag&quot;: 42, # For multi-channel audio, this is the channel number corresponding to the
Dan O'Mearadd494642020-05-01 07:42:23 -0700733 # recognized result for the audio from that channel.
Bu Sun Kim65020912020-05-20 12:08:20 -0700734 # For audio_channel_count = N, its output values can range from &#x27;1&#x27; to &#x27;N&#x27;.
735 &quot;languageCode&quot;: &quot;A String&quot;, # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
736 # of the language in this result. This language code was detected to have
737 # the most likelihood of being spoken in the audio.
738 &quot;alternatives&quot;: [ # May contain one or more recognition hypotheses (up to the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700739 # maximum specified in `max_alternatives`).
740 # These alternatives are ordered in terms of accuracy, with the top (first)
741 # alternative being the most probable, as ranked by the recognizer.
742 { # Alternative hypotheses (a.k.a. n-best list).
Bu Sun Kim65020912020-05-20 12:08:20 -0700743 &quot;confidence&quot;: 3.14, # The confidence estimate between 0.0 and 1.0. A higher number
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700744 # indicates an estimated greater likelihood that the recognized words are
745 # correct. This field is set only for the top alternative of a non-streaming
746 # result or, of a streaming result where `is_final=true`.
747 # This field is not guaranteed to be accurate and users should not rely on it
748 # to be always provided.
749 # The default of 0.0 is a sentinel value indicating `confidence` was not set.
Bu Sun Kim65020912020-05-20 12:08:20 -0700750 &quot;transcript&quot;: &quot;A String&quot;, # Transcript text representing the words that the user spoke.
751 &quot;words&quot;: [ # A list of word-specific information for each recognized word.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700752 # Note: When `enable_speaker_diarization` is true, you will see all the words
753 # from the beginning of the audio.
754 { # Word-specific information for recognized words.
Bu Sun Kim65020912020-05-20 12:08:20 -0700755 &quot;endTime&quot;: &quot;A String&quot;, # Time offset relative to the beginning of the audio,
756 # and corresponding to the end of the spoken word.
757 # This field is only set if `enable_word_time_offsets=true` and only
758 # in the top hypothesis.
759 # This is an experimental feature and the accuracy of the time offset can
760 # vary.
761 &quot;confidence&quot;: 3.14, # The confidence estimate between 0.0 and 1.0. A higher number
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700762 # indicates an estimated greater likelihood that the recognized words are
763 # correct. This field is set only for the top alternative of a non-streaming
764 # result or, of a streaming result where `is_final=true`.
765 # This field is not guaranteed to be accurate and users should not rely on it
766 # to be always provided.
767 # The default of 0.0 is a sentinel value indicating `confidence` was not set.
Bu Sun Kim65020912020-05-20 12:08:20 -0700768 &quot;startTime&quot;: &quot;A String&quot;, # Time offset relative to the beginning of the audio,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700769 # and corresponding to the start of the spoken word.
770 # This field is only set if `enable_word_time_offsets=true` and only
771 # in the top hypothesis.
772 # This is an experimental feature and the accuracy of the time offset can
773 # vary.
Bu Sun Kim65020912020-05-20 12:08:20 -0700774 &quot;word&quot;: &quot;A String&quot;, # The word corresponding to this set of information.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700775 &quot;speakerTag&quot;: 42, # Output only. A distinct integer value is assigned for every speaker within
776 # the audio. This field specifies which one of those speakers was detected to
777 # have spoken this word. Value ranges from &#x27;1&#x27; to diarization_speaker_count.
778 # speaker_tag is set if enable_speaker_diarization = &#x27;true&#x27; and only in the
779 # top alternative.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700780 },
781 ],
782 },
783 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700784 },
785 ],
786 }</pre>
787</div>
788
789</body></html>