blob: ea18d85319a13a30c7b3c32fed08443acb893c76 [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.
Dan O'Mearadd494642020-05-01 07:42:23 -070099 "audio": { # Contains audio data in the encoding specified in the `RecognitionConfig`. # Required. The audio data to be recognized.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700100 # Either `content` or `uri` must be supplied. Supplying both or neither
101 # returns google.rpc.Code.INVALID_ARGUMENT. See
Dan O'Mearadd494642020-05-01 07:42:23 -0700102 # [content limits](https://cloud.google.com/speech-to-text/quotas#content).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700103 "content": "A String", # The audio data bytes encoded as specified in
104 # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
105 # pure binary representation, whereas JSON representations use base64.
106 "uri": "A String", # URI that points to a file that contains audio data bytes as specified in
107 # `RecognitionConfig`. The file must not be compressed (for example, gzip).
108 # Currently, only Google Cloud Storage URIs are
109 # supported, which must be specified in the following format:
110 # `gs://bucket_name/object_name` (other URI formats return
111 # google.rpc.Code.INVALID_ARGUMENT). For more information, see
112 # [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
113 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700114 "config": { # 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 -0700115 # process the request.
116 # request.
Dan O'Mearadd494642020-05-01 07:42:23 -0700117 "languageCode": "A String", # Required. The language of the supplied audio as a
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118 # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
119 # Example: "en-US".
Dan O'Mearadd494642020-05-01 07:42:23 -0700120 # See [Language
121 # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
122 # of the currently supported language codes.
123 "audioChannelCount": 42, # The number of channels in the input audio data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700124 # ONLY set this for MULTI-CHANNEL recognition.
125 # Valid values for LINEAR16 and FLAC are `1`-`8`.
126 # Valid values for OGG_OPUS are '1'-'254'.
127 # Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
128 # If `0` or omitted, defaults to one channel (mono).
129 # Note: We only recognize the first channel by default.
130 # To perform independent recognition on each channel set
131 # `enable_separate_recognition_per_channel` to 'true'.
132 "encoding": "A String", # Encoding of audio data sent in all `RecognitionAudio` messages.
133 # This field is optional for `FLAC` and `WAV` audio files and required
134 # for all other audio formats. For details, see AudioEncoding.
Dan O'Mearadd494642020-05-01 07:42:23 -0700135 "enableAutomaticPunctuation": True or False, # If 'true', adds punctuation to recognition result hypotheses.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700136 # This feature is only available in select languages. Setting this for
137 # requests in other languages has no effect at all.
138 # The default 'false' value does not add punctuation to result hypotheses.
Dan O'Mearadd494642020-05-01 07:42:23 -0700139 "alternativeLanguageCodes": [ # A list of up to 3 additional
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700140 # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
141 # listing possible alternative languages of the supplied audio.
Dan O'Mearadd494642020-05-01 07:42:23 -0700142 # See [Language
143 # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
144 # of the currently supported language codes. If alternative languages are
145 # listed, recognition result will contain recognition in the most likely
146 # language detected including the main language_code. The recognition result
147 # will include the language tag of the language detected in the audio. Note:
148 # This feature is only supported for Voice Command and Voice Search use cases
149 # and performance may vary for other use cases (e.g., phone call
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700150 # transcription).
151 "A String",
152 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700153 "enableSeparateRecognitionPerChannel": 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 -0700154 # to get each channel recognized separately. The recognition result will
155 # contain a `channel_tag` field to state which channel that result belongs
156 # to. If this is not true, we will only recognize the first channel. The
157 # request is billed cumulatively for all channels recognized:
158 # `audio_channel_count` multiplied by the length of the audio.
Dan O'Mearadd494642020-05-01 07:42:23 -0700159 "enableWordTimeOffsets": True or False, # If `true`, the top result includes a list of words and
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700160 # the start and end time offsets (timestamps) for those words. If
161 # `false`, no word-level time offset information is returned. The default is
162 # `false`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700163 "enableSpeakerDiarization": True or False, # If 'true', enables speaker detection for each recognized word in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700164 # the top alternative of the recognition result using a speaker_tag provided
165 # in the WordInfo.
Dan O'Mearadd494642020-05-01 07:42:23 -0700166 # Note: Use diarization_config instead.
167 "maxAlternatives": 42, # Maximum number of recognition hypotheses to be returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700168 # Specifically, the maximum number of `SpeechRecognitionAlternative` messages
169 # within each `SpeechRecognitionResult`.
170 # The server may return fewer than `max_alternatives`.
171 # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
172 # one. If omitted, will return a maximum of one.
Dan O'Mearadd494642020-05-01 07:42:23 -0700173 "profanityFilter": True or False, # If set to `true`, the server will attempt to filter out
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700174 # profanities, replacing all but the initial character in each filtered word
175 # with asterisks, e.g. "f***". If set to `false` or omitted, profanities
176 # won't be filtered out.
Dan O'Mearadd494642020-05-01 07:42:23 -0700177 "useEnhanced": True or False, # Set to true to use an enhanced model for speech recognition.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700178 # If `use_enhanced` is set to true and the `model` field is not set, then
Dan O'Mearadd494642020-05-01 07:42:23 -0700179 # an appropriate enhanced model is chosen if an enhanced model exists for
180 # the audio.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700181 #
182 # If `use_enhanced` is true and an enhanced version of the specified model
183 # does not exist, then the speech is recognized using the standard version
184 # of the specified model.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700185 "sampleRateHertz": 42, # Sample rate in Hertz of the audio data sent in all
186 # `RecognitionAudio` messages. Valid values are: 8000-48000.
187 # 16000 is optimal. For best results, set the sampling rate of the audio
188 # source to 16000 Hz. If that's not possible, use the native sample rate of
189 # the audio source (instead of re-sampling).
190 # This field is optional for FLAC and WAV audio files, but is
191 # required for all other audio formats. For details, see AudioEncoding.
Dan O'Mearadd494642020-05-01 07:42:23 -0700192 "adaptation": { # Speech adaptation configuration. # Speech adaptation configuration improves the accuracy of speech
193 # recognition. When speech adaptation is set it supersedes the
194 # `speech_contexts` field. For more information, see the [speech
195 # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
196 # documentation.
197 "phraseSets": [ # A collection of phrase sets. To specify the hints inline, leave the
198 # phrase set's `name` blank and fill in the rest of its fields. Any
199 # phrase set can use any custom class.
200 { # Provides "hints" to the speech recognizer to favor specific words and phrases
201 # in the results.
202 "phrases": [ # A list of word and phrases.
203 { # A phrases containing words and phrase "hints" so that
204 # the speech recognition is more likely to recognize them. This can be used
205 # to improve the accuracy for specific words and phrases, for example, if
206 # specific commands are typically spoken by the user. This can also be used
207 # to add additional words to the vocabulary of the recognizer. See
208 # [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
209 #
210 # List items can also include pre-built or custom classes containing groups
211 # of words that represent common concepts that occur in natural language. For
212 # example, rather than providing a phrase hint for every month of the
213 # year (e.g. "i was born in january", "i was born in febuary", ...), use the
214 # pre-built $MONTH class improves the likelihood of correctly transcribing
215 # audio that includes months (e.g. "i was born in $month").
216 # To refer to pre-built classes, use the class' symbol prepended with $ e.g.
217 # $MONTH. To refer to custom classes that were defined inline in the request,
218 # set the class's `custom_class_id` to a string unique to all class resources
219 # and inline classes. Then use the class' id wrapped in ${...} e.g.
220 # "${my-months}". To refer to custom classes resources, use the class' id
221 # wrapped in ${} (e.g.
222 # ${my-months}).
223 "boost": 3.14, # Hint Boost. Overrides the boost set at the phrase set level.
224 # Positive value will increase the probability that a specific phrase will
225 # be recognized over other similar sounding phrases. The higher the boost,
226 # the higher the chance of false positive recognition as well. Negative
227 # boost values would correspond to anti-biasing. Anti-biasing is not
228 # enabled, so negative boost will simply be ignored. Though `boost` can
229 # accept a wide range of positive values, most use cases are best served
230 # with values between 0 and 20. We recommend using a binary search approach
231 # to finding the optimal value for your use case. Speech recognition
232 # will skip PhraseSets with a boost value of 0.
233 "value": "A String", # The phrase itself.
234 },
235 ],
236 "boost": 3.14, # Hint Boost. Positive value will increase the probability that a specific
237 # phrase will be recognized over other similar sounding phrases. The higher
238 # the boost, the higher the chance of false positive recognition as well.
239 # Negative boost values would correspond to anti-biasing. Anti-biasing is not
240 # enabled, so negative boost will simply be ignored. Though `boost` can
241 # accept a wide range of positive values, most use cases are best served with
242 # values between 0 (exclusive) and 20. We recommend using a binary search
243 # approach to finding the optimal value for your use case. Speech recognition
244 # will skip PhraseSets with a boost value of 0.
245 "name": "A String", # The resource name of the phrase set.
246 },
247 ],
248 "customClasses": [ # A collection of custom classes. To specify the classes inline, leave the
249 # class' `name` blank and fill in the rest of its fields, giving it a unique
250 # `custom_class_id`. Refer to the inline defined class in phrase hints by its
251 # `custom_class_id`.
252 { # A set of words or phrases that represents a common concept likely to appear
253 # in your audio, for example a list of passenger ship names. CustomClass items
254 # can be substituted into placeholders that you set in PhraseSet phrases.
255 "items": [ # A collection of class items.
256 { # An item of the class.
257 "value": "A String", # The class item's value.
258 },
259 ],
260 "name": "A String", # The resource name of the custom class.
261 "customClassId": "A String", # If this custom class is a resource, the custom_class_id is the resource id
262 # of the CustomClass.
263 },
264 ],
265 },
266 "diarizationSpeakerCount": 42, # If set, specifies the estimated number of speakers in the conversation.
267 # Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
268 # Note: Use diarization_config instead.
269 "enableWordConfidence": True or False, # If `true`, the top result includes a list of words and the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700270 # confidence for those words. If `false`, no word-level confidence
271 # information is returned. The default is `false`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700272 "model": "A String", # Which model to select for the given request. Select the model
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700273 # best suited to your domain to get best results. If a model is not
274 # explicitly specified, then we auto-select a model based on the parameters
275 # in the RecognitionConfig.
Dan O'Mearadd494642020-05-01 07:42:23 -0700276 # &lt;table&gt;
277 # &lt;tr&gt;
278 # &lt;td&gt;&lt;b&gt;Model&lt;/b&gt;&lt;/td&gt;
279 # &lt;td&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/td&gt;
280 # &lt;/tr&gt;
281 # &lt;tr&gt;
282 # &lt;td&gt;&lt;code&gt;command_and_search&lt;/code&gt;&lt;/td&gt;
283 # &lt;td&gt;Best for short queries such as voice commands or voice search.&lt;/td&gt;
284 # &lt;/tr&gt;
285 # &lt;tr&gt;
286 # &lt;td&gt;&lt;code&gt;phone_call&lt;/code&gt;&lt;/td&gt;
287 # &lt;td&gt;Best for audio that originated from a phone call (typically
288 # recorded at an 8khz sampling rate).&lt;/td&gt;
289 # &lt;/tr&gt;
290 # &lt;tr&gt;
291 # &lt;td&gt;&lt;code&gt;video&lt;/code&gt;&lt;/td&gt;
292 # &lt;td&gt;Best for audio that originated from from video or includes multiple
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700293 # speakers. Ideally the audio is recorded at a 16khz or greater
294 # sampling rate. This is a premium model that costs more than the
Dan O'Mearadd494642020-05-01 07:42:23 -0700295 # standard rate.&lt;/td&gt;
296 # &lt;/tr&gt;
297 # &lt;tr&gt;
298 # &lt;td&gt;&lt;code&gt;default&lt;/code&gt;&lt;/td&gt;
299 # &lt;td&gt;Best for audio that is not one of the specific audio models.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700300 # For example, long-form audio. Ideally the audio is high-fidelity,
Dan O'Mearadd494642020-05-01 07:42:23 -0700301 # recorded at a 16khz or greater sampling rate.&lt;/td&gt;
302 # &lt;/tr&gt;
303 # &lt;/table&gt;
304 "diarizationConfig": { # Config to enable speaker diarization. # Config to enable speaker diarization and set additional
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700305 # parameters to make diarization better suited for your application.
306 # Note: When this is enabled, we send all the words from the beginning of the
307 # audio for the top alternative in every consecutive STREAMING responses.
308 # This is done in order to improve our speaker tags as our models learn to
309 # identify the speakers in the conversation over time.
310 # For non-streaming requests, the diarization results will be provided only
311 # in the top alternative of the FINAL SpeechRecognitionResult.
Dan O'Mearadd494642020-05-01 07:42:23 -0700312 "minSpeakerCount": 42, # Minimum number of speakers in the conversation. This range gives you more
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700313 # flexibility by allowing the system to automatically determine the correct
314 # number of speakers. If not set, the default value is 2.
Dan O'Mearadd494642020-05-01 07:42:23 -0700315 "enableSpeakerDiarization": True or False, # If 'true', enables speaker detection for each recognized word in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700316 # the top alternative of the recognition result using a speaker_tag provided
317 # in the WordInfo.
Dan O'Mearadd494642020-05-01 07:42:23 -0700318 "maxSpeakerCount": 42, # Maximum number of speakers in the conversation. This range gives you more
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700319 # flexibility by allowing the system to automatically determine the correct
320 # number of speakers. If not set, the default value is 6.
Dan O'Mearadd494642020-05-01 07:42:23 -0700321 "speakerTag": 42, # Output only. Unused.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700322 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700323 "speechContexts": [ # Array of SpeechContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700324 # A means to provide context to assist the speech recognition. For more
Dan O'Mearadd494642020-05-01 07:42:23 -0700325 # information, see
326 # [speech
327 # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700328 { # Provides "hints" to the speech recognizer to favor specific words and phrases
329 # in the results.
Dan O'Mearadd494642020-05-01 07:42:23 -0700330 "phrases": [ # A list of strings containing words and phrases "hints" so that
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700331 # the speech recognition is more likely to recognize them. This can be used
332 # to improve the accuracy for specific words and phrases, for example, if
333 # specific commands are typically spoken by the user. This can also be used
334 # to add additional words to the vocabulary of the recognizer. See
Dan O'Mearadd494642020-05-01 07:42:23 -0700335 # [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700336 #
337 # List items can also be set to classes for groups of words that represent
338 # common concepts that occur in natural language. For example, rather than
339 # providing phrase hints for every month of the year, using the $MONTH class
340 # improves the likelihood of correctly transcribing audio that includes
341 # months.
342 "A String",
343 ],
344 "boost": 3.14, # Hint Boost. Positive value will increase the probability that a specific
345 # phrase will be recognized over other similar sounding phrases. The higher
346 # the boost, the higher the chance of false positive recognition as well.
347 # Negative boost values would correspond to anti-biasing. Anti-biasing is not
348 # enabled, so negative boost will simply be ignored. Though `boost` can
349 # accept a wide range of positive values, most use cases are best served with
350 # values between 0 and 20. We recommend using a binary search approach to
351 # finding the optimal value for your use case.
352 },
353 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700354 "metadata": { # Description of audio data to be recognized. # Metadata regarding this request.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700355 "recordingDeviceType": "A String", # The type of device the speech was recorded with.
356 "originalMediaType": "A String", # The original media the speech was recorded on.
357 "microphoneDistance": "A String", # The audio type that most closely describes the audio being recognized.
358 "obfuscatedId": "A String", # Obfuscated (privacy-protected) ID of the user, to identify number of
359 # unique users using the service.
360 "recordingDeviceName": "A String", # The device used to make the recording. Examples 'Nexus 5X' or
361 # 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
362 # 'Cardioid Microphone'.
363 "industryNaicsCodeOfAudio": 42, # The industry vertical to which this speech recognition request most
364 # closely applies. This is most indicative of the topics contained
365 # in the audio. Use the 6-digit NAICS code to identify the industry
366 # vertical - see https://www.naics.com/search/.
367 "audioTopic": "A String", # Description of the content. Eg. "Recordings of federal supreme court
368 # hearings from 2012".
369 "originalMimeType": "A String", # Mime type of the original audio file. For example `audio/m4a`,
370 # `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
371 # A list of possible audio mime types is maintained at
372 # http://www.iana.org/assignments/media-types/media-types.xhtml#audio
373 "interactionType": "A String", # The use case most closely describing the audio content to be recognized.
374 },
375 },
376 }
377
378 x__xgafv: string, V1 error format.
379 Allowed values
380 1 - v1 error format
381 2 - v2 error format
382
383Returns:
384 An object of the form:
385
386 { # This resource represents a long-running operation that is the result of a
387 # network API call.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700388 "error": { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation.
389 # different programming environments, including REST APIs and RPC APIs. It is
390 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
391 # three pieces of data: error code, error message, and error details.
392 #
393 # You can find out more about this error model and how to work with it in the
394 # [API Design Guide](https://cloud.google.com/apis/design/errors).
395 "message": "A String", # A developer-facing error message, which should be in English. Any
396 # user-facing error message should be localized and sent in the
397 # google.rpc.Status.details field, or localized by the client.
398 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
399 "details": [ # A list of messages that carry the error details. There is a common set of
400 # message types for APIs to use.
401 {
402 "a_key": "", # Properties of the object. Contains field @type with type URL.
403 },
404 ],
405 },
406 "done": True or False, # If the value is `false`, it means the operation is still in progress.
407 # If `true`, the operation is completed, and either `error` or `response` is
408 # available.
409 "response": { # The normal response of the operation in case of success. If the original
410 # method returns no data on success, such as `Delete`, the response is
411 # `google.protobuf.Empty`. If the original method is standard
412 # `Get`/`Create`/`Update`, the response should be the resource. For other
413 # methods, the response should have the type `XxxResponse`, where `Xxx`
414 # is the original method name. For example, if the original method name
415 # is `TakeSnapshot()`, the inferred response type is
416 # `TakeSnapshotResponse`.
417 "a_key": "", # Properties of the object. Contains field @type with type URL.
418 },
419 "name": "A String", # The server-assigned name, which is only unique within the same service that
420 # originally returns it. If you use the default HTTP mapping, the
421 # `name` should be a resource name ending with `operations/{unique_id}`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700422 "metadata": { # Service-specific metadata associated with the operation. It typically
423 # contains progress information and common metadata such as create time.
424 # Some services might not provide such metadata. Any method that returns a
425 # long-running operation should document the metadata type, if any.
426 "a_key": "", # Properties of the object. Contains field @type with type URL.
427 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700428 }</pre>
429</div>
430
431<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700432 <code class="details" id="recognize">recognize(body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700433 <pre>Performs synchronous speech recognition: receive results after all audio
434has been sent and processed.
435
436Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700437 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700438 The object takes the form of:
439
440{ # The top-level message sent by the client for the `Recognize` method.
Dan O'Mearadd494642020-05-01 07:42:23 -0700441 "audio": { # Contains audio data in the encoding specified in the `RecognitionConfig`. # Required. The audio data to be recognized.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700442 # Either `content` or `uri` must be supplied. Supplying both or neither
443 # returns google.rpc.Code.INVALID_ARGUMENT. See
Dan O'Mearadd494642020-05-01 07:42:23 -0700444 # [content limits](https://cloud.google.com/speech-to-text/quotas#content).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700445 "content": "A String", # The audio data bytes encoded as specified in
446 # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
447 # pure binary representation, whereas JSON representations use base64.
448 "uri": "A String", # URI that points to a file that contains audio data bytes as specified in
449 # `RecognitionConfig`. The file must not be compressed (for example, gzip).
450 # Currently, only Google Cloud Storage URIs are
451 # supported, which must be specified in the following format:
452 # `gs://bucket_name/object_name` (other URI formats return
453 # google.rpc.Code.INVALID_ARGUMENT). For more information, see
454 # [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
455 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700456 "config": { # 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 -0700457 # process the request.
458 # request.
Dan O'Mearadd494642020-05-01 07:42:23 -0700459 "languageCode": "A String", # Required. The language of the supplied audio as a
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700460 # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
461 # Example: "en-US".
Dan O'Mearadd494642020-05-01 07:42:23 -0700462 # See [Language
463 # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
464 # of the currently supported language codes.
465 "audioChannelCount": 42, # The number of channels in the input audio data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700466 # ONLY set this for MULTI-CHANNEL recognition.
467 # Valid values for LINEAR16 and FLAC are `1`-`8`.
468 # Valid values for OGG_OPUS are '1'-'254'.
469 # Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
470 # If `0` or omitted, defaults to one channel (mono).
471 # Note: We only recognize the first channel by default.
472 # To perform independent recognition on each channel set
473 # `enable_separate_recognition_per_channel` to 'true'.
474 "encoding": "A String", # Encoding of audio data sent in all `RecognitionAudio` messages.
475 # This field is optional for `FLAC` and `WAV` audio files and required
476 # for all other audio formats. For details, see AudioEncoding.
Dan O'Mearadd494642020-05-01 07:42:23 -0700477 "enableAutomaticPunctuation": True or False, # If 'true', adds punctuation to recognition result hypotheses.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700478 # This feature is only available in select languages. Setting this for
479 # requests in other languages has no effect at all.
480 # The default 'false' value does not add punctuation to result hypotheses.
Dan O'Mearadd494642020-05-01 07:42:23 -0700481 "alternativeLanguageCodes": [ # A list of up to 3 additional
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700482 # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
483 # listing possible alternative languages of the supplied audio.
Dan O'Mearadd494642020-05-01 07:42:23 -0700484 # See [Language
485 # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
486 # of the currently supported language codes. If alternative languages are
487 # listed, recognition result will contain recognition in the most likely
488 # language detected including the main language_code. The recognition result
489 # will include the language tag of the language detected in the audio. Note:
490 # This feature is only supported for Voice Command and Voice Search use cases
491 # and performance may vary for other use cases (e.g., phone call
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700492 # transcription).
493 "A String",
494 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700495 "enableSeparateRecognitionPerChannel": 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 -0700496 # to get each channel recognized separately. The recognition result will
497 # contain a `channel_tag` field to state which channel that result belongs
498 # to. If this is not true, we will only recognize the first channel. The
499 # request is billed cumulatively for all channels recognized:
500 # `audio_channel_count` multiplied by the length of the audio.
Dan O'Mearadd494642020-05-01 07:42:23 -0700501 "enableWordTimeOffsets": True or False, # If `true`, the top result includes a list of words and
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700502 # the start and end time offsets (timestamps) for those words. If
503 # `false`, no word-level time offset information is returned. The default is
504 # `false`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700505 "enableSpeakerDiarization": True or False, # If 'true', enables speaker detection for each recognized word in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700506 # the top alternative of the recognition result using a speaker_tag provided
507 # in the WordInfo.
Dan O'Mearadd494642020-05-01 07:42:23 -0700508 # Note: Use diarization_config instead.
509 "maxAlternatives": 42, # Maximum number of recognition hypotheses to be returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700510 # Specifically, the maximum number of `SpeechRecognitionAlternative` messages
511 # within each `SpeechRecognitionResult`.
512 # The server may return fewer than `max_alternatives`.
513 # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
514 # one. If omitted, will return a maximum of one.
Dan O'Mearadd494642020-05-01 07:42:23 -0700515 "profanityFilter": True or False, # If set to `true`, the server will attempt to filter out
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700516 # profanities, replacing all but the initial character in each filtered word
517 # with asterisks, e.g. "f***". If set to `false` or omitted, profanities
518 # won't be filtered out.
Dan O'Mearadd494642020-05-01 07:42:23 -0700519 "useEnhanced": True or False, # Set to true to use an enhanced model for speech recognition.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700520 # If `use_enhanced` is set to true and the `model` field is not set, then
Dan O'Mearadd494642020-05-01 07:42:23 -0700521 # an appropriate enhanced model is chosen if an enhanced model exists for
522 # the audio.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700523 #
524 # If `use_enhanced` is true and an enhanced version of the specified model
525 # does not exist, then the speech is recognized using the standard version
526 # of the specified model.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700527 "sampleRateHertz": 42, # Sample rate in Hertz of the audio data sent in all
528 # `RecognitionAudio` messages. Valid values are: 8000-48000.
529 # 16000 is optimal. For best results, set the sampling rate of the audio
530 # source to 16000 Hz. If that's not possible, use the native sample rate of
531 # the audio source (instead of re-sampling).
532 # This field is optional for FLAC and WAV audio files, but is
533 # required for all other audio formats. For details, see AudioEncoding.
Dan O'Mearadd494642020-05-01 07:42:23 -0700534 "adaptation": { # Speech adaptation configuration. # Speech adaptation configuration improves the accuracy of speech
535 # recognition. When speech adaptation is set it supersedes the
536 # `speech_contexts` field. For more information, see the [speech
537 # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
538 # documentation.
539 "phraseSets": [ # A collection of phrase sets. To specify the hints inline, leave the
540 # phrase set's `name` blank and fill in the rest of its fields. Any
541 # phrase set can use any custom class.
542 { # Provides "hints" to the speech recognizer to favor specific words and phrases
543 # in the results.
544 "phrases": [ # A list of word and phrases.
545 { # A phrases containing words and phrase "hints" so that
546 # the speech recognition is more likely to recognize them. This can be used
547 # to improve the accuracy for specific words and phrases, for example, if
548 # specific commands are typically spoken by the user. This can also be used
549 # to add additional words to the vocabulary of the recognizer. See
550 # [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
551 #
552 # List items can also include pre-built or custom classes containing groups
553 # of words that represent common concepts that occur in natural language. For
554 # example, rather than providing a phrase hint for every month of the
555 # year (e.g. "i was born in january", "i was born in febuary", ...), use the
556 # pre-built $MONTH class improves the likelihood of correctly transcribing
557 # audio that includes months (e.g. "i was born in $month").
558 # To refer to pre-built classes, use the class' symbol prepended with $ e.g.
559 # $MONTH. To refer to custom classes that were defined inline in the request,
560 # set the class's `custom_class_id` to a string unique to all class resources
561 # and inline classes. Then use the class' id wrapped in ${...} e.g.
562 # "${my-months}". To refer to custom classes resources, use the class' id
563 # wrapped in ${} (e.g.
564 # ${my-months}).
565 "boost": 3.14, # Hint Boost. Overrides the boost set at the phrase set level.
566 # Positive value will increase the probability that a specific phrase will
567 # be recognized over other similar sounding phrases. The higher the boost,
568 # the higher the chance of false positive recognition as well. Negative
569 # boost values would correspond to anti-biasing. Anti-biasing is not
570 # enabled, so negative boost will simply be ignored. Though `boost` can
571 # accept a wide range of positive values, most use cases are best served
572 # with values between 0 and 20. We recommend using a binary search approach
573 # to finding the optimal value for your use case. Speech recognition
574 # will skip PhraseSets with a boost value of 0.
575 "value": "A String", # The phrase itself.
576 },
577 ],
578 "boost": 3.14, # Hint Boost. Positive value will increase the probability that a specific
579 # phrase will be recognized over other similar sounding phrases. The higher
580 # the boost, the higher the chance of false positive recognition as well.
581 # Negative boost values would correspond to anti-biasing. Anti-biasing is not
582 # enabled, so negative boost will simply be ignored. Though `boost` can
583 # accept a wide range of positive values, most use cases are best served with
584 # values between 0 (exclusive) and 20. We recommend using a binary search
585 # approach to finding the optimal value for your use case. Speech recognition
586 # will skip PhraseSets with a boost value of 0.
587 "name": "A String", # The resource name of the phrase set.
588 },
589 ],
590 "customClasses": [ # A collection of custom classes. To specify the classes inline, leave the
591 # class' `name` blank and fill in the rest of its fields, giving it a unique
592 # `custom_class_id`. Refer to the inline defined class in phrase hints by its
593 # `custom_class_id`.
594 { # A set of words or phrases that represents a common concept likely to appear
595 # in your audio, for example a list of passenger ship names. CustomClass items
596 # can be substituted into placeholders that you set in PhraseSet phrases.
597 "items": [ # A collection of class items.
598 { # An item of the class.
599 "value": "A String", # The class item's value.
600 },
601 ],
602 "name": "A String", # The resource name of the custom class.
603 "customClassId": "A String", # If this custom class is a resource, the custom_class_id is the resource id
604 # of the CustomClass.
605 },
606 ],
607 },
608 "diarizationSpeakerCount": 42, # If set, specifies the estimated number of speakers in the conversation.
609 # Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
610 # Note: Use diarization_config instead.
611 "enableWordConfidence": True or False, # If `true`, the top result includes a list of words and the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700612 # confidence for those words. If `false`, no word-level confidence
613 # information is returned. The default is `false`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700614 "model": "A String", # Which model to select for the given request. Select the model
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700615 # best suited to your domain to get best results. If a model is not
616 # explicitly specified, then we auto-select a model based on the parameters
617 # in the RecognitionConfig.
Dan O'Mearadd494642020-05-01 07:42:23 -0700618 # &lt;table&gt;
619 # &lt;tr&gt;
620 # &lt;td&gt;&lt;b&gt;Model&lt;/b&gt;&lt;/td&gt;
621 # &lt;td&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/td&gt;
622 # &lt;/tr&gt;
623 # &lt;tr&gt;
624 # &lt;td&gt;&lt;code&gt;command_and_search&lt;/code&gt;&lt;/td&gt;
625 # &lt;td&gt;Best for short queries such as voice commands or voice search.&lt;/td&gt;
626 # &lt;/tr&gt;
627 # &lt;tr&gt;
628 # &lt;td&gt;&lt;code&gt;phone_call&lt;/code&gt;&lt;/td&gt;
629 # &lt;td&gt;Best for audio that originated from a phone call (typically
630 # recorded at an 8khz sampling rate).&lt;/td&gt;
631 # &lt;/tr&gt;
632 # &lt;tr&gt;
633 # &lt;td&gt;&lt;code&gt;video&lt;/code&gt;&lt;/td&gt;
634 # &lt;td&gt;Best for audio that originated from from video or includes multiple
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700635 # speakers. Ideally the audio is recorded at a 16khz or greater
636 # sampling rate. This is a premium model that costs more than the
Dan O'Mearadd494642020-05-01 07:42:23 -0700637 # standard rate.&lt;/td&gt;
638 # &lt;/tr&gt;
639 # &lt;tr&gt;
640 # &lt;td&gt;&lt;code&gt;default&lt;/code&gt;&lt;/td&gt;
641 # &lt;td&gt;Best for audio that is not one of the specific audio models.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700642 # For example, long-form audio. Ideally the audio is high-fidelity,
Dan O'Mearadd494642020-05-01 07:42:23 -0700643 # recorded at a 16khz or greater sampling rate.&lt;/td&gt;
644 # &lt;/tr&gt;
645 # &lt;/table&gt;
646 "diarizationConfig": { # Config to enable speaker diarization. # Config to enable speaker diarization and set additional
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700647 # parameters to make diarization better suited for your application.
648 # Note: When this is enabled, we send all the words from the beginning of the
649 # audio for the top alternative in every consecutive STREAMING responses.
650 # This is done in order to improve our speaker tags as our models learn to
651 # identify the speakers in the conversation over time.
652 # For non-streaming requests, the diarization results will be provided only
653 # in the top alternative of the FINAL SpeechRecognitionResult.
Dan O'Mearadd494642020-05-01 07:42:23 -0700654 "minSpeakerCount": 42, # Minimum number of speakers in the conversation. This range gives you more
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700655 # flexibility by allowing the system to automatically determine the correct
656 # number of speakers. If not set, the default value is 2.
Dan O'Mearadd494642020-05-01 07:42:23 -0700657 "enableSpeakerDiarization": True or False, # If 'true', enables speaker detection for each recognized word in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700658 # the top alternative of the recognition result using a speaker_tag provided
659 # in the WordInfo.
Dan O'Mearadd494642020-05-01 07:42:23 -0700660 "maxSpeakerCount": 42, # Maximum number of speakers in the conversation. This range gives you more
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700661 # flexibility by allowing the system to automatically determine the correct
662 # number of speakers. If not set, the default value is 6.
Dan O'Mearadd494642020-05-01 07:42:23 -0700663 "speakerTag": 42, # Output only. Unused.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700664 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700665 "speechContexts": [ # Array of SpeechContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700666 # A means to provide context to assist the speech recognition. For more
Dan O'Mearadd494642020-05-01 07:42:23 -0700667 # information, see
668 # [speech
669 # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700670 { # Provides "hints" to the speech recognizer to favor specific words and phrases
671 # in the results.
Dan O'Mearadd494642020-05-01 07:42:23 -0700672 "phrases": [ # A list of strings containing words and phrases "hints" so that
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700673 # the speech recognition is more likely to recognize them. This can be used
674 # to improve the accuracy for specific words and phrases, for example, if
675 # specific commands are typically spoken by the user. This can also be used
676 # to add additional words to the vocabulary of the recognizer. See
Dan O'Mearadd494642020-05-01 07:42:23 -0700677 # [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700678 #
679 # List items can also be set to classes for groups of words that represent
680 # common concepts that occur in natural language. For example, rather than
681 # providing phrase hints for every month of the year, using the $MONTH class
682 # improves the likelihood of correctly transcribing audio that includes
683 # months.
684 "A String",
685 ],
686 "boost": 3.14, # Hint Boost. Positive value will increase the probability that a specific
687 # phrase will be recognized over other similar sounding phrases. The higher
688 # the boost, the higher the chance of false positive recognition as well.
689 # Negative boost values would correspond to anti-biasing. Anti-biasing is not
690 # enabled, so negative boost will simply be ignored. Though `boost` can
691 # accept a wide range of positive values, most use cases are best served with
692 # values between 0 and 20. We recommend using a binary search approach to
693 # finding the optimal value for your use case.
694 },
695 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700696 "metadata": { # Description of audio data to be recognized. # Metadata regarding this request.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700697 "recordingDeviceType": "A String", # The type of device the speech was recorded with.
698 "originalMediaType": "A String", # The original media the speech was recorded on.
699 "microphoneDistance": "A String", # The audio type that most closely describes the audio being recognized.
700 "obfuscatedId": "A String", # Obfuscated (privacy-protected) ID of the user, to identify number of
701 # unique users using the service.
702 "recordingDeviceName": "A String", # The device used to make the recording. Examples 'Nexus 5X' or
703 # 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
704 # 'Cardioid Microphone'.
705 "industryNaicsCodeOfAudio": 42, # The industry vertical to which this speech recognition request most
706 # closely applies. This is most indicative of the topics contained
707 # in the audio. Use the 6-digit NAICS code to identify the industry
708 # vertical - see https://www.naics.com/search/.
709 "audioTopic": "A String", # Description of the content. Eg. "Recordings of federal supreme court
710 # hearings from 2012".
711 "originalMimeType": "A String", # Mime type of the original audio file. For example `audio/m4a`,
712 # `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
713 # A list of possible audio mime types is maintained at
714 # http://www.iana.org/assignments/media-types/media-types.xhtml#audio
715 "interactionType": "A String", # The use case most closely describing the audio content to be recognized.
716 },
717 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700718 }
719
720 x__xgafv: string, V1 error format.
721 Allowed values
722 1 - v1 error format
723 2 - v2 error format
724
725Returns:
726 An object of the form:
727
728 { # The only message returned to the client by the `Recognize` method. It
729 # contains the result as zero or more sequential `SpeechRecognitionResult`
730 # messages.
Dan O'Mearadd494642020-05-01 07:42:23 -0700731 "results": [ # Sequential list of transcription results corresponding to
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700732 # sequential portions of audio.
733 { # A speech recognition result corresponding to a portion of the audio.
Dan O'Mearadd494642020-05-01 07:42:23 -0700734 "channelTag": 42, # For multi-channel audio, this is the channel number corresponding to the
735 # recognized result for the audio from that channel.
736 # For audio_channel_count = N, its output values can range from '1' to 'N'.
737 "alternatives": [ # May contain one or more recognition hypotheses (up to the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700738 # maximum specified in `max_alternatives`).
739 # These alternatives are ordered in terms of accuracy, with the top (first)
740 # alternative being the most probable, as ranked by the recognizer.
741 { # Alternative hypotheses (a.k.a. n-best list).
Dan O'Mearadd494642020-05-01 07:42:23 -0700742 "confidence": 3.14, # The confidence estimate between 0.0 and 1.0. A higher number
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700743 # indicates an estimated greater likelihood that the recognized words are
744 # correct. This field is set only for the top alternative of a non-streaming
745 # result or, of a streaming result where `is_final=true`.
746 # This field is not guaranteed to be accurate and users should not rely on it
747 # to be always provided.
748 # The default of 0.0 is a sentinel value indicating `confidence` was not set.
Dan O'Mearadd494642020-05-01 07:42:23 -0700749 "transcript": "A String", # Transcript text representing the words that the user spoke.
750 "words": [ # A list of word-specific information for each recognized word.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700751 # Note: When `enable_speaker_diarization` is true, you will see all the words
752 # from the beginning of the audio.
753 { # Word-specific information for recognized words.
Dan O'Mearadd494642020-05-01 07:42:23 -0700754 "confidence": 3.14, # The confidence estimate between 0.0 and 1.0. A higher number
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700755 # indicates an estimated greater likelihood that the recognized words are
756 # correct. This field is set only for the top alternative of a non-streaming
757 # result or, of a streaming result where `is_final=true`.
758 # This field is not guaranteed to be accurate and users should not rely on it
759 # to be always provided.
760 # The default of 0.0 is a sentinel value indicating `confidence` was not set.
Dan O'Mearadd494642020-05-01 07:42:23 -0700761 "endTime": "A String", # Time offset relative to the beginning of the audio,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700762 # and corresponding to the end of the spoken word.
763 # This field is only set if `enable_word_time_offsets=true` and only
764 # in the top hypothesis.
765 # This is an experimental feature and the accuracy of the time offset can
766 # vary.
Dan O'Mearadd494642020-05-01 07:42:23 -0700767 "word": "A String", # The word corresponding to this set of information.
768 "startTime": "A String", # 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.
774 "speakerTag": 42, # Output only. A distinct integer value is assigned for every speaker within
775 # the audio. This field specifies which one of those speakers was detected to
776 # have spoken this word. Value ranges from '1' to diarization_speaker_count.
777 # speaker_tag is set if enable_speaker_diarization = 'true' and only in the
778 # top alternative.
779 },
780 ],
781 },
782 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700783 "languageCode": "A String", # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
784 # of the language in this result. This language code was detected to have
785 # the most likelihood of being spoken in the audio.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700786 },
787 ],
788 }</pre>
789</div>
790
791</body></html>