google-cloud-speech-v1p1beta1 0.1.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Speech
23
+ module V1p1beta1
24
+ module Speech
25
+ # Path helper methods for the Speech API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified CustomClass resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/customClasses/{custom_class}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param custom_class [String]
37
+ #
38
+ # @return [::String]
39
+ def custom_class_path project:, location:, custom_class:
40
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
42
+
43
+ "projects/#{project}/locations/#{location}/customClasses/#{custom_class}"
44
+ end
45
+
46
+ ##
47
+ # Create a fully-qualified PhraseSet resource string.
48
+ #
49
+ # The resource will be in the following format:
50
+ #
51
+ # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
52
+ #
53
+ # @param project [String]
54
+ # @param location [String]
55
+ # @param phrase_set [String]
56
+ #
57
+ # @return [::String]
58
+ def phrase_set_path project:, location:, phrase_set:
59
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
60
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
61
+
62
+ "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}"
63
+ end
64
+
65
+ extend self
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Speech
23
23
  module V1p1beta1
24
- VERSION = "0.1.1"
24
+ VERSION = "0.3.1"
25
25
  end
26
26
  end
27
27
  end
@@ -128,7 +128,7 @@ module Google
128
128
  # - pattern: "shelves/{shelf}"
129
129
  # parent_type: "cloudresourcemanager.googleapis.com/Folder"
130
130
  # @!attribute [rw] type
131
- # @return [String]
131
+ # @return [::String]
132
132
  # The resource type. It must be in the format of
133
133
  # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be
134
134
  # singular and must not include version numbers.
@@ -140,7 +140,7 @@ module Google
140
140
  # should use PascalCase (UpperCamelCase). The maximum number of
141
141
  # characters allowed for the `resource_type_kind` is 100.
142
142
  # @!attribute [rw] pattern
143
- # @return [Array<String>]
143
+ # @return [::Array<::String>]
144
144
  # Optional. The relative resource name pattern associated with this resource
145
145
  # type. The DNS prefix of the full resource name shouldn't be specified here.
146
146
  #
@@ -161,11 +161,11 @@ module Google
161
161
  # the same component name (e.g. "project") refers to IDs of the same
162
162
  # type of resource.
163
163
  # @!attribute [rw] name_field
164
- # @return [String]
164
+ # @return [::String]
165
165
  # Optional. The field on the resource that designates the resource name
166
166
  # field. If omitted, this is assumed to be "name".
167
167
  # @!attribute [rw] history
168
- # @return [Google::Api::ResourceDescriptor::History]
168
+ # @return [::Google::Api::ResourceDescriptor::History]
169
169
  # Optional. The historical or future-looking state of the resource pattern.
170
170
  #
171
171
  # Example:
@@ -182,19 +182,19 @@ module Google
182
182
  # };
183
183
  # }
184
184
  # @!attribute [rw] plural
185
- # @return [String]
185
+ # @return [::String]
186
186
  # The plural name used in the resource name, such as 'projects' for
187
187
  # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
188
  # field in k8s CRD spec
189
189
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
190
190
  # @!attribute [rw] singular
191
- # @return [String]
191
+ # @return [::String]
192
192
  # The same concept of the `singular` field in k8s CRD spec
193
193
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
194
  # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
195
195
  class ResourceDescriptor
196
- include Google::Protobuf::MessageExts
197
- extend Google::Protobuf::MessageExts::ClassMethods
196
+ include ::Google::Protobuf::MessageExts
197
+ extend ::Google::Protobuf::MessageExts::ClassMethods
198
198
 
199
199
  # A description of the historical or future-looking state of the
200
200
  # resource pattern.
@@ -216,7 +216,7 @@ module Google
216
216
  # Defines a proto annotation that describes a string field that refers to
217
217
  # an API resource.
218
218
  # @!attribute [rw] type
219
- # @return [String]
219
+ # @return [::String]
220
220
  # The resource type that the annotated field references.
221
221
  #
222
222
  # Example:
@@ -227,7 +227,7 @@ module Google
227
227
  # }];
228
228
  # }
229
229
  # @!attribute [rw] child_type
230
- # @return [String]
230
+ # @return [::String]
231
231
  # The resource type of a child collection that the annotated field
232
232
  # references. This is useful for annotating the `parent` field that
233
233
  # doesn't have a fixed resource type.
@@ -240,8 +240,8 @@ module Google
240
240
  # };
241
241
  # }
242
242
  class ResourceReference
243
- include Google::Protobuf::MessageExts
244
- extend Google::Protobuf::MessageExts::ClassMethods
243
+ include ::Google::Protobuf::MessageExts
244
+ extend ::Google::Protobuf::MessageExts::ClassMethods
245
245
  end
246
246
  end
247
247
  end
@@ -23,29 +23,29 @@ module Google
23
23
  module V1p1beta1
24
24
  # The top-level message sent by the client for the `Recognize` method.
25
25
  # @!attribute [rw] config
26
- # @return [Google::Cloud::Speech::V1p1beta1::RecognitionConfig]
26
+ # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig]
27
27
  # Required. Provides information to the recognizer that specifies how to
28
28
  # process the request.
29
29
  # @!attribute [rw] audio
30
- # @return [Google::Cloud::Speech::V1p1beta1::RecognitionAudio]
30
+ # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio]
31
31
  # Required. The audio data to be recognized.
32
32
  class RecognizeRequest
33
- include Google::Protobuf::MessageExts
34
- extend Google::Protobuf::MessageExts::ClassMethods
33
+ include ::Google::Protobuf::MessageExts
34
+ extend ::Google::Protobuf::MessageExts::ClassMethods
35
35
  end
36
36
 
37
37
  # The top-level message sent by the client for the `LongRunningRecognize`
38
38
  # method.
39
39
  # @!attribute [rw] config
40
- # @return [Google::Cloud::Speech::V1p1beta1::RecognitionConfig]
40
+ # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig]
41
41
  # Required. Provides information to the recognizer that specifies how to
42
42
  # process the request.
43
43
  # @!attribute [rw] audio
44
- # @return [Google::Cloud::Speech::V1p1beta1::RecognitionAudio]
44
+ # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio]
45
45
  # Required. The audio data to be recognized.
46
46
  class LongRunningRecognizeRequest
47
- include Google::Protobuf::MessageExts
48
- extend Google::Protobuf::MessageExts::ClassMethods
47
+ include ::Google::Protobuf::MessageExts
48
+ extend ::Google::Protobuf::MessageExts::ClassMethods
49
49
  end
50
50
 
51
51
  # The top-level message sent by the client for the `StreamingRecognize` method.
@@ -54,12 +54,12 @@ module Google
54
54
  # `audio_content`. All subsequent messages must contain `audio_content` and
55
55
  # must not contain a `streaming_config` message.
56
56
  # @!attribute [rw] streaming_config
57
- # @return [Google::Cloud::Speech::V1p1beta1::StreamingRecognitionConfig]
57
+ # @return [::Google::Cloud::Speech::V1p1beta1::StreamingRecognitionConfig]
58
58
  # Provides information to the recognizer that specifies how to process the
59
59
  # request. The first `StreamingRecognizeRequest` message must contain a
60
60
  # `streaming_config` message.
61
61
  # @!attribute [rw] audio_content
62
- # @return [String]
62
+ # @return [::String]
63
63
  # The audio data to be recognized. Sequential chunks of audio data are sent
64
64
  # in sequential `StreamingRecognizeRequest` messages. The first
65
65
  # `StreamingRecognizeRequest` message must not contain `audio_content` data
@@ -69,18 +69,18 @@ module Google
69
69
  # pure binary representation (not base64). See
70
70
  # [content limits](https://cloud.google.com/speech-to-text/quotas#content).
71
71
  class StreamingRecognizeRequest
72
- include Google::Protobuf::MessageExts
73
- extend Google::Protobuf::MessageExts::ClassMethods
72
+ include ::Google::Protobuf::MessageExts
73
+ extend ::Google::Protobuf::MessageExts::ClassMethods
74
74
  end
75
75
 
76
76
  # Provides information to the recognizer that specifies how to process the
77
77
  # request.
78
78
  # @!attribute [rw] config
79
- # @return [Google::Cloud::Speech::V1p1beta1::RecognitionConfig]
79
+ # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig]
80
80
  # Required. Provides information to the recognizer that specifies how to
81
81
  # process the request.
82
82
  # @!attribute [rw] single_utterance
83
- # @return [Boolean]
83
+ # @return [::Boolean]
84
84
  # If `false` or omitted, the recognizer will perform continuous
85
85
  # recognition (continuing to wait for and process audio even if the user
86
86
  # pauses speaking) until the client closes the input stream (gRPC API) or
@@ -93,34 +93,36 @@ module Google
93
93
  # more than one `StreamingRecognitionResult` with the `is_final` flag set to
94
94
  # `true`.
95
95
  # @!attribute [rw] interim_results
96
- # @return [Boolean]
96
+ # @return [::Boolean]
97
97
  # If `true`, interim results (tentative hypotheses) may be
98
98
  # returned as they become available (these interim results are indicated with
99
99
  # the `is_final=false` flag).
100
100
  # If `false` or omitted, only `is_final=true` result(s) are returned.
101
101
  class StreamingRecognitionConfig
102
- include Google::Protobuf::MessageExts
103
- extend Google::Protobuf::MessageExts::ClassMethods
102
+ include ::Google::Protobuf::MessageExts
103
+ extend ::Google::Protobuf::MessageExts::ClassMethods
104
104
  end
105
105
 
106
106
  # Provides information to the recognizer that specifies how to process the
107
107
  # request.
108
108
  # @!attribute [rw] encoding
109
- # @return [Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding]
109
+ # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding]
110
110
  # Encoding of audio data sent in all `RecognitionAudio` messages.
111
111
  # This field is optional for `FLAC` and `WAV` audio files and required
112
- # for all other audio formats. For details, see {Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}.
112
+ # for all other audio formats. For details, see
113
+ # {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}.
113
114
  # @!attribute [rw] sample_rate_hertz
114
- # @return [Integer]
115
+ # @return [::Integer]
115
116
  # Sample rate in Hertz of the audio data sent in all
116
117
  # `RecognitionAudio` messages. Valid values are: 8000-48000.
117
118
  # 16000 is optimal. For best results, set the sampling rate of the audio
118
119
  # source to 16000 Hz. If that's not possible, use the native sample rate of
119
120
  # the audio source (instead of re-sampling).
120
121
  # This field is optional for FLAC and WAV audio files, but is
121
- # required for all other audio formats. For details, see {Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}.
122
+ # required for all other audio formats. For details, see
123
+ # {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}.
122
124
  # @!attribute [rw] audio_channel_count
123
- # @return [Integer]
125
+ # @return [::Integer]
124
126
  # The number of channels in the input audio data.
125
127
  # ONLY set this for MULTI-CHANNEL recognition.
126
128
  # Valid values for LINEAR16 and FLAC are `1`-`8`.
@@ -131,7 +133,7 @@ module Google
131
133
  # To perform independent recognition on each channel set
132
134
  # `enable_separate_recognition_per_channel` to 'true'.
133
135
  # @!attribute [rw] enable_separate_recognition_per_channel
134
- # @return [Boolean]
136
+ # @return [::Boolean]
135
137
  # This needs to be set to `true` explicitly and `audio_channel_count` > 1
136
138
  # to get each channel recognized separately. The recognition result will
137
139
  # contain a `channel_tag` field to state which channel that result belongs
@@ -139,7 +141,7 @@ module Google
139
141
  # request is billed cumulatively for all channels recognized:
140
142
  # `audio_channel_count` multiplied by the length of the audio.
141
143
  # @!attribute [rw] language_code
142
- # @return [String]
144
+ # @return [::String]
143
145
  # Required. The language of the supplied audio as a
144
146
  # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
145
147
  # Example: "en-US".
@@ -147,7 +149,7 @@ module Google
147
149
  # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
148
150
  # of the currently supported language codes.
149
151
  # @!attribute [rw] alternative_language_codes
150
- # @return [Array<String>]
152
+ # @return [::Array<::String>]
151
153
  # A list of up to 3 additional
152
154
  # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
153
155
  # listing possible alternative languages of the supplied audio.
@@ -161,7 +163,7 @@ module Google
161
163
  # and performance may vary for other use cases (e.g., phone call
162
164
  # transcription).
163
165
  # @!attribute [rw] max_alternatives
164
- # @return [Integer]
166
+ # @return [::Integer]
165
167
  # Maximum number of recognition hypotheses to be returned.
166
168
  # Specifically, the maximum number of `SpeechRecognitionAlternative` messages
167
169
  # within each `SpeechRecognitionResult`.
@@ -169,51 +171,55 @@ module Google
169
171
  # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
170
172
  # one. If omitted, will return a maximum of one.
171
173
  # @!attribute [rw] profanity_filter
172
- # @return [Boolean]
174
+ # @return [::Boolean]
173
175
  # If set to `true`, the server will attempt to filter out
174
176
  # profanities, replacing all but the initial character in each filtered word
175
177
  # with asterisks, e.g. "f***". If set to `false` or omitted, profanities
176
178
  # won't be filtered out.
179
+ # @!attribute [rw] adaptation
180
+ # @return [::Google::Cloud::Speech::V1p1beta1::SpeechAdaptation]
181
+ # Speech adaptation configuration improves the accuracy of speech
182
+ # recognition. When speech adaptation is set it supersedes the
183
+ # `speech_contexts` field. For more information, see the [speech
184
+ # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength)
185
+ # documentation.
177
186
  # @!attribute [rw] speech_contexts
178
- # @return [Array<Google::Cloud::Speech::V1p1beta1::SpeechContext>]
179
- # Array of {Google::Cloud::Speech::V1p1beta1::SpeechContext SpeechContext}.
187
+ # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechContext>]
188
+ # Array of {::Google::Cloud::Speech::V1p1beta1::SpeechContext SpeechContext}.
180
189
  # A means to provide context to assist the speech recognition. For more
181
190
  # information, see
182
191
  # [speech
183
192
  # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
184
193
  # @!attribute [rw] enable_word_time_offsets
185
- # @return [Boolean]
194
+ # @return [::Boolean]
186
195
  # If `true`, the top result includes a list of words and
187
196
  # the start and end time offsets (timestamps) for those words. If
188
197
  # `false`, no word-level time offset information is returned. The default is
189
198
  # `false`.
190
199
  # @!attribute [rw] enable_word_confidence
191
- # @return [Boolean]
200
+ # @return [::Boolean]
192
201
  # If `true`, the top result includes a list of words and the
193
202
  # confidence for those words. If `false`, no word-level confidence
194
203
  # information is returned. The default is `false`.
195
204
  # @!attribute [rw] enable_automatic_punctuation
196
- # @return [Boolean]
205
+ # @return [::Boolean]
197
206
  # If 'true', adds punctuation to recognition result hypotheses.
198
207
  # This feature is only available in select languages. Setting this for
199
208
  # requests in other languages has no effect at all.
200
209
  # The default 'false' value does not add punctuation to result hypotheses.
201
- # Note: This is currently offered as an experimental service, complimentary
202
- # to all users. In the future this may be exclusively available as a
203
- # premium feature.
204
210
  # @!attribute [rw] enable_speaker_diarization
205
- # @return [Boolean]
211
+ # @return [::Boolean]
206
212
  # If 'true', enables speaker detection for each recognized word in
207
213
  # the top alternative of the recognition result using a speaker_tag provided
208
214
  # in the WordInfo.
209
215
  # Note: Use diarization_config instead.
210
216
  # @!attribute [rw] diarization_speaker_count
211
- # @return [Integer]
217
+ # @return [::Integer]
212
218
  # If set, specifies the estimated number of speakers in the conversation.
213
219
  # Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
214
220
  # Note: Use diarization_config instead.
215
221
  # @!attribute [rw] diarization_config
216
- # @return [Google::Cloud::Speech::V1p1beta1::SpeakerDiarizationConfig]
222
+ # @return [::Google::Cloud::Speech::V1p1beta1::SpeakerDiarizationConfig]
217
223
  # Config to enable speaker diarization and set additional
218
224
  # parameters to make diarization better suited for your application.
219
225
  # Note: When this is enabled, we send all the words from the beginning of the
@@ -223,10 +229,10 @@ module Google
223
229
  # For non-streaming requests, the diarization results will be provided only
224
230
  # in the top alternative of the FINAL SpeechRecognitionResult.
225
231
  # @!attribute [rw] metadata
226
- # @return [Google::Cloud::Speech::V1p1beta1::RecognitionMetadata]
232
+ # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata]
227
233
  # Metadata regarding this request.
228
234
  # @!attribute [rw] model
229
- # @return [String]
235
+ # @return [::String]
230
236
  # Which model to select for the given request. Select the model
231
237
  # best suited to your domain to get best results. If a model is not
232
238
  # explicitly specified, then we auto-select a model based on the parameters
@@ -260,7 +266,7 @@ module Google
260
266
  # </tr>
261
267
  # </table>
262
268
  # @!attribute [rw] use_enhanced
263
- # @return [Boolean]
269
+ # @return [::Boolean]
264
270
  # Set to true to use an enhanced model for speech recognition.
265
271
  # If `use_enhanced` is set to true and the `model` field is not set, then
266
272
  # an appropriate enhanced model is chosen if an enhanced model exists for
@@ -270,8 +276,8 @@ module Google
270
276
  # does not exist, then the speech is recognized using the standard version
271
277
  # of the specified model.
272
278
  class RecognitionConfig
273
- include Google::Protobuf::MessageExts
274
- extend Google::Protobuf::MessageExts::ClassMethods
279
+ include ::Google::Protobuf::MessageExts
280
+ extend ::Google::Protobuf::MessageExts::ClassMethods
275
281
 
276
282
  # The encoding of the audio data sent in the request.
277
283
  #
@@ -294,7 +300,8 @@ module Google
294
300
  # an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the
295
301
  # encoding configuration must match the encoding described in the audio
296
302
  # header; otherwise the request returns an
297
- # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code.
303
+ # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error
304
+ # code.
298
305
  module AudioEncoding
299
306
  # Not specified.
300
307
  ENCODING_UNSPECIFIED = 0
@@ -340,74 +347,77 @@ module Google
340
347
  SPEEX_WITH_HEADER_BYTE = 7
341
348
 
342
349
  # MP3 audio. Support all standard MP3 bitrates (which range from 32-320
343
- # kbps). When using this encoding, `sample_rate_hertz` can be optionally
344
- # unset if not known.
350
+ # kbps). When using this encoding, `sample_rate_hertz` has to match the
351
+ # sample rate of the file being used.
345
352
  MP3 = 8
346
353
  end
347
354
  end
348
355
 
349
356
  # Config to enable speaker diarization.
350
357
  # @!attribute [rw] enable_speaker_diarization
351
- # @return [Boolean]
358
+ # @return [::Boolean]
352
359
  # If 'true', enables speaker detection for each recognized word in
353
360
  # the top alternative of the recognition result using a speaker_tag provided
354
361
  # in the WordInfo.
355
362
  # @!attribute [rw] min_speaker_count
356
- # @return [Integer]
363
+ # @return [::Integer]
357
364
  # Minimum number of speakers in the conversation. This range gives you more
358
365
  # flexibility by allowing the system to automatically determine the correct
359
366
  # number of speakers. If not set, the default value is 2.
360
367
  # @!attribute [rw] max_speaker_count
361
- # @return [Integer]
368
+ # @return [::Integer]
362
369
  # Maximum number of speakers in the conversation. This range gives you more
363
370
  # flexibility by allowing the system to automatically determine the correct
364
371
  # number of speakers. If not set, the default value is 6.
372
+ # @!attribute [r] speaker_tag
373
+ # @return [::Integer]
374
+ # Output only. Unused.
365
375
  class SpeakerDiarizationConfig
366
- include Google::Protobuf::MessageExts
367
- extend Google::Protobuf::MessageExts::ClassMethods
376
+ include ::Google::Protobuf::MessageExts
377
+ extend ::Google::Protobuf::MessageExts::ClassMethods
368
378
  end
369
379
 
370
380
  # Description of audio data to be recognized.
371
381
  # @!attribute [rw] interaction_type
372
- # @return [Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::InteractionType]
382
+ # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::InteractionType]
373
383
  # The use case most closely describing the audio content to be recognized.
374
384
  # @!attribute [rw] industry_naics_code_of_audio
375
- # @return [Integer]
385
+ # @return [::Integer]
376
386
  # The industry vertical to which this speech recognition request most
377
387
  # closely applies. This is most indicative of the topics contained
378
388
  # in the audio. Use the 6-digit NAICS code to identify the industry
379
389
  # vertical - see https://www.naics.com/search/.
380
390
  # @!attribute [rw] microphone_distance
381
- # @return [Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::MicrophoneDistance]
391
+ # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::MicrophoneDistance]
382
392
  # The audio type that most closely describes the audio being recognized.
383
393
  # @!attribute [rw] original_media_type
384
- # @return [Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::OriginalMediaType]
394
+ # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::OriginalMediaType]
385
395
  # The original media the speech was recorded on.
386
396
  # @!attribute [rw] recording_device_type
387
- # @return [Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::RecordingDeviceType]
397
+ # @return [::Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::RecordingDeviceType]
388
398
  # The type of device the speech was recorded with.
389
399
  # @!attribute [rw] recording_device_name
390
- # @return [String]
400
+ # @return [::String]
391
401
  # The device used to make the recording. Examples 'Nexus 5X' or
392
402
  # 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
393
403
  # 'Cardioid Microphone'.
394
404
  # @!attribute [rw] original_mime_type
395
- # @return [String]
405
+ # @return [::String]
396
406
  # Mime type of the original audio file. For example `audio/m4a`,
397
407
  # `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
398
408
  # A list of possible audio mime types is maintained at
399
409
  # http://www.iana.org/assignments/media-types/media-types.xhtml#audio
400
410
  # @!attribute [rw] obfuscated_id
401
- # @return [Integer]
411
+ # @return [::Integer]
402
412
  # Obfuscated (privacy-protected) ID of the user, to identify number of
403
413
  # unique users using the service.
404
414
  # @!attribute [rw] audio_topic
405
- # @return [String]
415
+ # @return [::String]
406
416
  # Description of the content. Eg. "Recordings of federal supreme court
407
417
  # hearings from 2012".
408
418
  class RecognitionMetadata
409
- include Google::Protobuf::MessageExts
410
- extend Google::Protobuf::MessageExts::ClassMethods
419
+ include ::Google::Protobuf::MessageExts
420
+ extend ::Google::Protobuf::MessageExts::ClassMethods
411
421
 
412
422
  # Use case categories that the audio recognition request can be described
413
423
  # by.
@@ -504,7 +514,7 @@ module Google
504
514
  # Provides "hints" to the speech recognizer to favor specific words and phrases
505
515
  # in the results.
506
516
  # @!attribute [rw] phrases
507
- # @return [Array<String>]
517
+ # @return [::Array<::String>]
508
518
  # A list of strings containing words and phrases "hints" so that
509
519
  # the speech recognition is more likely to recognize them. This can be used
510
520
  # to improve the accuracy for specific words and phrases, for example, if
@@ -518,7 +528,7 @@ module Google
518
528
  # improves the likelihood of correctly transcribing audio that includes
519
529
  # months.
520
530
  # @!attribute [rw] boost
521
- # @return [Float]
531
+ # @return [::Float]
522
532
  # Hint Boost. Positive value will increase the probability that a specific
523
533
  # phrase will be recognized over other similar sounding phrases. The higher
524
534
  # the boost, the higher the chance of false positive recognition as well.
@@ -528,43 +538,44 @@ module Google
528
538
  # values between 0 and 20. We recommend using a binary search approach to
529
539
  # finding the optimal value for your use case.
530
540
  class SpeechContext
531
- include Google::Protobuf::MessageExts
532
- extend Google::Protobuf::MessageExts::ClassMethods
541
+ include ::Google::Protobuf::MessageExts
542
+ extend ::Google::Protobuf::MessageExts::ClassMethods
533
543
  end
534
544
 
535
545
  # Contains audio data in the encoding specified in the `RecognitionConfig`.
536
546
  # Either `content` or `uri` must be supplied. Supplying both or neither
537
- # returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
538
- # [content limits](https://cloud.google.com/speech-to-text/quotas#content).
547
+ # returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
548
+ # See [content limits](https://cloud.google.com/speech-to-text/quotas#content).
539
549
  # @!attribute [rw] content
540
- # @return [String]
550
+ # @return [::String]
541
551
  # The audio data bytes encoded as specified in
542
552
  # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
543
553
  # pure binary representation, whereas JSON representations use base64.
544
554
  # @!attribute [rw] uri
545
- # @return [String]
555
+ # @return [::String]
546
556
  # URI that points to a file that contains audio data bytes as specified in
547
557
  # `RecognitionConfig`. The file must not be compressed (for example, gzip).
548
558
  # Currently, only Google Cloud Storage URIs are
549
559
  # supported, which must be specified in the following format:
550
560
  # `gs://bucket_name/object_name` (other URI formats return
551
- # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
552
- # [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
561
+ # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
562
+ # For more information, see [Request
563
+ # URIs](https://cloud.google.com/storage/docs/reference-uris).
553
564
  class RecognitionAudio
554
- include Google::Protobuf::MessageExts
555
- extend Google::Protobuf::MessageExts::ClassMethods
565
+ include ::Google::Protobuf::MessageExts
566
+ extend ::Google::Protobuf::MessageExts::ClassMethods
556
567
  end
557
568
 
558
569
  # The only message returned to the client by the `Recognize` method. It
559
570
  # contains the result as zero or more sequential `SpeechRecognitionResult`
560
571
  # messages.
561
572
  # @!attribute [rw] results
562
- # @return [Array<Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>]
573
+ # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>]
563
574
  # Sequential list of transcription results corresponding to
564
575
  # sequential portions of audio.
565
576
  class RecognizeResponse
566
- include Google::Protobuf::MessageExts
567
- extend Google::Protobuf::MessageExts::ClassMethods
577
+ include ::Google::Protobuf::MessageExts
578
+ extend ::Google::Protobuf::MessageExts::ClassMethods
568
579
  end
569
580
 
570
581
  # The only message returned to the client by the `LongRunningRecognize` method.
@@ -573,30 +584,34 @@ module Google
573
584
  # returned by the `GetOperation` call of the `google::longrunning::Operations`
574
585
  # service.
575
586
  # @!attribute [rw] results
576
- # @return [Array<Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>]
587
+ # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>]
577
588
  # Sequential list of transcription results corresponding to
578
589
  # sequential portions of audio.
579
590
  class LongRunningRecognizeResponse
580
- include Google::Protobuf::MessageExts
581
- extend Google::Protobuf::MessageExts::ClassMethods
591
+ include ::Google::Protobuf::MessageExts
592
+ extend ::Google::Protobuf::MessageExts::ClassMethods
582
593
  end
583
594
 
584
595
  # Describes the progress of a long-running `LongRunningRecognize` call. It is
585
596
  # included in the `metadata` field of the `Operation` returned by the
586
597
  # `GetOperation` call of the `google::longrunning::Operations` service.
587
598
  # @!attribute [rw] progress_percent
588
- # @return [Integer]
599
+ # @return [::Integer]
589
600
  # Approximate percentage of audio processed thus far. Guaranteed to be 100
590
601
  # when the audio is fully processed and the results are available.
591
602
  # @!attribute [rw] start_time
592
- # @return [Google::Protobuf::Timestamp]
603
+ # @return [::Google::Protobuf::Timestamp]
593
604
  # Time when the request was received.
594
605
  # @!attribute [rw] last_update_time
595
- # @return [Google::Protobuf::Timestamp]
606
+ # @return [::Google::Protobuf::Timestamp]
596
607
  # Time of the most recent processing update.
608
+ # @!attribute [r] uri
609
+ # @return [::String]
610
+ # The URI of the audio file being transcribed. Empty if the audio was sent
611
+ # as byte content.
597
612
  class LongRunningRecognizeMetadata
598
- include Google::Protobuf::MessageExts
599
- extend Google::Protobuf::MessageExts::ClassMethods
613
+ include ::Google::Protobuf::MessageExts
614
+ extend ::Google::Protobuf::MessageExts::ClassMethods
600
615
  end
601
616
 
602
617
  # `StreamingRecognizeResponse` is the only message returned to the client by
@@ -649,21 +664,21 @@ module Google
649
664
  # `speech_event_type`, or
650
665
  # one or more (repeated) `results`.
651
666
  # @!attribute [rw] error
652
- # @return [Google::Rpc::Status]
653
- # If set, returns a {Google::Rpc::Status google.rpc.Status} message that
667
+ # @return [::Google::Rpc::Status]
668
+ # If set, returns a {::Google::Rpc::Status google.rpc.Status} message that
654
669
  # specifies the error for the operation.
655
670
  # @!attribute [rw] results
656
- # @return [Array<Google::Cloud::Speech::V1p1beta1::StreamingRecognitionResult>]
671
+ # @return [::Array<::Google::Cloud::Speech::V1p1beta1::StreamingRecognitionResult>]
657
672
  # This repeated list contains zero or more results that
658
673
  # correspond to consecutive portions of the audio currently being processed.
659
674
  # It contains zero or one `is_final=true` result (the newly settled portion),
660
675
  # followed by zero or more `is_final=false` results (the interim results).
661
676
  # @!attribute [rw] speech_event_type
662
- # @return [Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse::SpeechEventType]
677
+ # @return [::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse::SpeechEventType]
663
678
  # Indicates the type of speech event.
664
679
  class StreamingRecognizeResponse
665
- include Google::Protobuf::MessageExts
666
- extend Google::Protobuf::MessageExts::ClassMethods
680
+ include ::Google::Protobuf::MessageExts
681
+ extend ::Google::Protobuf::MessageExts::ClassMethods
667
682
 
668
683
  # Indicates the type of speech event.
669
684
  module SpeechEventType
@@ -684,72 +699,72 @@ module Google
684
699
  # A streaming speech recognition result corresponding to a portion of the audio
685
700
  # that is currently being processed.
686
701
  # @!attribute [rw] alternatives
687
- # @return [Array<Google::Cloud::Speech::V1p1beta1::SpeechRecognitionAlternative>]
702
+ # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionAlternative>]
688
703
  # May contain one or more recognition hypotheses (up to the
689
704
  # maximum specified in `max_alternatives`).
690
705
  # These alternatives are ordered in terms of accuracy, with the top (first)
691
706
  # alternative being the most probable, as ranked by the recognizer.
692
707
  # @!attribute [rw] is_final
693
- # @return [Boolean]
708
+ # @return [::Boolean]
694
709
  # If `false`, this `StreamingRecognitionResult` represents an
695
710
  # interim result that may change. If `true`, this is the final time the
696
711
  # speech service will return this particular `StreamingRecognitionResult`,
697
712
  # the recognizer will not return any further hypotheses for this portion of
698
713
  # the transcript and corresponding audio.
699
714
  # @!attribute [rw] stability
700
- # @return [Float]
715
+ # @return [::Float]
701
716
  # An estimate of the likelihood that the recognizer will not
702
717
  # change its guess about this interim result. Values range from 0.0
703
718
  # (completely unstable) to 1.0 (completely stable).
704
719
  # This field is only provided for interim results (`is_final=false`).
705
720
  # The default of 0.0 is a sentinel value indicating `stability` was not set.
706
721
  # @!attribute [rw] result_end_time
707
- # @return [Google::Protobuf::Duration]
722
+ # @return [::Google::Protobuf::Duration]
708
723
  # Time offset of the end of this result relative to the
709
724
  # beginning of the audio.
710
725
  # @!attribute [rw] channel_tag
711
- # @return [Integer]
726
+ # @return [::Integer]
712
727
  # For multi-channel audio, this is the channel number corresponding to the
713
728
  # recognized result for the audio from that channel.
714
729
  # For audio_channel_count = N, its output values can range from '1' to 'N'.
715
- # @!attribute [rw] language_code
716
- # @return [String]
717
- # The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
718
- # of the language in this result. This language code was detected to have
719
- # the most likelihood of being spoken in the audio.
730
+ # @!attribute [r] language_code
731
+ # @return [::String]
732
+ # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
733
+ # language tag of the language in this result. This language code was
734
+ # detected to have the most likelihood of being spoken in the audio.
720
735
  class StreamingRecognitionResult
721
- include Google::Protobuf::MessageExts
722
- extend Google::Protobuf::MessageExts::ClassMethods
736
+ include ::Google::Protobuf::MessageExts
737
+ extend ::Google::Protobuf::MessageExts::ClassMethods
723
738
  end
724
739
 
725
740
  # A speech recognition result corresponding to a portion of the audio.
726
741
  # @!attribute [rw] alternatives
727
- # @return [Array<Google::Cloud::Speech::V1p1beta1::SpeechRecognitionAlternative>]
742
+ # @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionAlternative>]
728
743
  # May contain one or more recognition hypotheses (up to the
729
744
  # maximum specified in `max_alternatives`).
730
745
  # These alternatives are ordered in terms of accuracy, with the top (first)
731
746
  # alternative being the most probable, as ranked by the recognizer.
732
747
  # @!attribute [rw] channel_tag
733
- # @return [Integer]
748
+ # @return [::Integer]
734
749
  # For multi-channel audio, this is the channel number corresponding to the
735
750
  # recognized result for the audio from that channel.
736
751
  # For audio_channel_count = N, its output values can range from '1' to 'N'.
737
- # @!attribute [rw] language_code
738
- # @return [String]
739
- # The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
740
- # of the language in this result. This language code was detected to have
741
- # the most likelihood of being spoken in the audio.
752
+ # @!attribute [r] language_code
753
+ # @return [::String]
754
+ # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
755
+ # language tag of the language in this result. This language code was
756
+ # detected to have the most likelihood of being spoken in the audio.
742
757
  class SpeechRecognitionResult
743
- include Google::Protobuf::MessageExts
744
- extend Google::Protobuf::MessageExts::ClassMethods
758
+ include ::Google::Protobuf::MessageExts
759
+ extend ::Google::Protobuf::MessageExts::ClassMethods
745
760
  end
746
761
 
747
762
  # Alternative hypotheses (a.k.a. n-best list).
748
763
  # @!attribute [rw] transcript
749
- # @return [String]
764
+ # @return [::String]
750
765
  # Transcript text representing the words that the user spoke.
751
766
  # @!attribute [rw] confidence
752
- # @return [Float]
767
+ # @return [::Float]
753
768
  # The confidence estimate between 0.0 and 1.0. A higher number
754
769
  # indicates an estimated greater likelihood that the recognized words are
755
770
  # correct. This field is set only for the top alternative of a non-streaming
@@ -758,18 +773,18 @@ module Google
758
773
  # to be always provided.
759
774
  # The default of 0.0 is a sentinel value indicating `confidence` was not set.
760
775
  # @!attribute [rw] words
761
- # @return [Array<Google::Cloud::Speech::V1p1beta1::WordInfo>]
776
+ # @return [::Array<::Google::Cloud::Speech::V1p1beta1::WordInfo>]
762
777
  # A list of word-specific information for each recognized word.
763
778
  # Note: When `enable_speaker_diarization` is true, you will see all the words
764
779
  # from the beginning of the audio.
765
780
  class SpeechRecognitionAlternative
766
- include Google::Protobuf::MessageExts
767
- extend Google::Protobuf::MessageExts::ClassMethods
781
+ include ::Google::Protobuf::MessageExts
782
+ extend ::Google::Protobuf::MessageExts::ClassMethods
768
783
  end
769
784
 
770
785
  # Word-specific information for recognized words.
771
786
  # @!attribute [rw] start_time
772
- # @return [Google::Protobuf::Duration]
787
+ # @return [::Google::Protobuf::Duration]
773
788
  # Time offset relative to the beginning of the audio,
774
789
  # and corresponding to the start of the spoken word.
775
790
  # This field is only set if `enable_word_time_offsets=true` and only
@@ -777,7 +792,7 @@ module Google
777
792
  # This is an experimental feature and the accuracy of the time offset can
778
793
  # vary.
779
794
  # @!attribute [rw] end_time
780
- # @return [Google::Protobuf::Duration]
795
+ # @return [::Google::Protobuf::Duration]
781
796
  # Time offset relative to the beginning of the audio,
782
797
  # and corresponding to the end of the spoken word.
783
798
  # This field is only set if `enable_word_time_offsets=true` and only
@@ -785,10 +800,10 @@ module Google
785
800
  # This is an experimental feature and the accuracy of the time offset can
786
801
  # vary.
787
802
  # @!attribute [rw] word
788
- # @return [String]
803
+ # @return [::String]
789
804
  # The word corresponding to this set of information.
790
805
  # @!attribute [rw] confidence
791
- # @return [Float]
806
+ # @return [::Float]
792
807
  # The confidence estimate between 0.0 and 1.0. A higher number
793
808
  # indicates an estimated greater likelihood that the recognized words are
794
809
  # correct. This field is set only for the top alternative of a non-streaming
@@ -796,16 +811,16 @@ module Google
796
811
  # This field is not guaranteed to be accurate and users should not rely on it
797
812
  # to be always provided.
798
813
  # The default of 0.0 is a sentinel value indicating `confidence` was not set.
799
- # @!attribute [rw] speaker_tag
800
- # @return [Integer]
801
- # A distinct integer value is assigned for every speaker within
814
+ # @!attribute [r] speaker_tag
815
+ # @return [::Integer]
816
+ # Output only. A distinct integer value is assigned for every speaker within
802
817
  # the audio. This field specifies which one of those speakers was detected to
803
818
  # have spoken this word. Value ranges from '1' to diarization_speaker_count.
804
819
  # speaker_tag is set if enable_speaker_diarization = 'true' and only in the
805
820
  # top alternative.
806
821
  class WordInfo
807
- include Google::Protobuf::MessageExts
808
- extend Google::Protobuf::MessageExts::ClassMethods
822
+ include ::Google::Protobuf::MessageExts
823
+ extend ::Google::Protobuf::MessageExts::ClassMethods
809
824
  end
810
825
  end
811
826
  end