google-cloud-speech-v1p1beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
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
+ VERSION = "0.1.0"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,4 @@
1
+ # Cloud Speech-to-Text V1p1beta1 Protocol Buffer Documentation
2
+
3
+ These files are for the YARD documentation of the generated protobuf files.
4
+ They are not intended to be required or loaded at runtime.
@@ -0,0 +1,59 @@
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 Api
22
+ # An indicator of the behavior of a given field (for example, that a field
23
+ # is required in requests, or given as output but ignored as input).
24
+ # This **does not** change the behavior in protocol buffers itself; it only
25
+ # denotes the behavior and may affect how API tooling handles the field.
26
+ #
27
+ # Note: This enum **may** receive new values in the future.
28
+ module FieldBehavior
29
+ # Conventional default for enums. Do not use this.
30
+ FIELD_BEHAVIOR_UNSPECIFIED = 0
31
+
32
+ # Specifically denotes a field as optional.
33
+ # While all fields in protocol buffers are optional, this may be specified
34
+ # for emphasis if appropriate.
35
+ OPTIONAL = 1
36
+
37
+ # Denotes a field as required.
38
+ # This indicates that the field **must** be provided as part of the request,
39
+ # and failure to do so will cause an error (usually `INVALID_ARGUMENT`).
40
+ REQUIRED = 2
41
+
42
+ # Denotes a field as output only.
43
+ # This indicates that the field is provided in responses, but including the
44
+ # field in a request does nothing (the server *must* ignore it and
45
+ # *must not* throw an error as a result of the field's presence).
46
+ OUTPUT_ONLY = 3
47
+
48
+ # Denotes a field as input only.
49
+ # This indicates that the field is provided in requests, and the
50
+ # corresponding field is not included in output.
51
+ INPUT_ONLY = 4
52
+
53
+ # Denotes a field as immutable.
54
+ # This indicates that the field may be set once in a request to create a
55
+ # resource, but may not be changed thereafter.
56
+ IMMUTABLE = 5
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,247 @@
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 Api
22
+ # A simple descriptor of a resource type.
23
+ #
24
+ # ResourceDescriptor annotates a resource message (either by means of a
25
+ # protobuf annotation or use in the service config), and associates the
26
+ # resource's schema, the resource type, and the pattern of the resource name.
27
+ #
28
+ # Example:
29
+ #
30
+ # message Topic {
31
+ # // Indicates this message defines a resource schema.
32
+ # // Declares the resource type in the format of {service}/{kind}.
33
+ # // For Kubernetes resources, the format is {api group}/{kind}.
34
+ # option (google.api.resource) = {
35
+ # type: "pubsub.googleapis.com/Topic"
36
+ # name_descriptor: {
37
+ # pattern: "projects/{project}/topics/{topic}"
38
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
+ # parent_name_extractor: "projects/{project}"
40
+ # }
41
+ # };
42
+ # }
43
+ #
44
+ # The ResourceDescriptor Yaml config will look like:
45
+ #
46
+ # resources:
47
+ # - type: "pubsub.googleapis.com/Topic"
48
+ # name_descriptor:
49
+ # - pattern: "projects/\\{project}/topics/\\{topic}"
50
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
+ # parent_name_extractor: "projects/\\{project}"
52
+ #
53
+ # Sometimes, resources have multiple patterns, typically because they can
54
+ # live under multiple parents.
55
+ #
56
+ # Example:
57
+ #
58
+ # message LogEntry {
59
+ # option (google.api.resource) = {
60
+ # type: "logging.googleapis.com/LogEntry"
61
+ # name_descriptor: {
62
+ # pattern: "projects/{project}/logs/{log}"
63
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
+ # parent_name_extractor: "projects/{project}"
65
+ # }
66
+ # name_descriptor: {
67
+ # pattern: "folders/{folder}/logs/{log}"
68
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
+ # parent_name_extractor: "folders/{folder}"
70
+ # }
71
+ # name_descriptor: {
72
+ # pattern: "organizations/{organization}/logs/{log}"
73
+ # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
+ # parent_name_extractor: "organizations/{organization}"
75
+ # }
76
+ # name_descriptor: {
77
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
+ # parent_type: "billing.googleapis.com/BillingAccount"
79
+ # parent_name_extractor: "billingAccounts/{billing_account}"
80
+ # }
81
+ # };
82
+ # }
83
+ #
84
+ # The ResourceDescriptor Yaml config will look like:
85
+ #
86
+ # resources:
87
+ # - type: 'logging.googleapis.com/LogEntry'
88
+ # name_descriptor:
89
+ # - pattern: "projects/{project}/logs/{log}"
90
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
+ # parent_name_extractor: "projects/{project}"
92
+ # - pattern: "folders/{folder}/logs/{log}"
93
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
+ # parent_name_extractor: "folders/{folder}"
95
+ # - pattern: "organizations/{organization}/logs/{log}"
96
+ # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
+ # parent_name_extractor: "organizations/{organization}"
98
+ # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
+ # parent_type: "billing.googleapis.com/BillingAccount"
100
+ # parent_name_extractor: "billingAccounts/{billing_account}"
101
+ #
102
+ # For flexible resources, the resource name doesn't contain parent names, but
103
+ # the resource itself has parents for policy evaluation.
104
+ #
105
+ # Example:
106
+ #
107
+ # message Shelf {
108
+ # option (google.api.resource) = {
109
+ # type: "library.googleapis.com/Shelf"
110
+ # name_descriptor: {
111
+ # pattern: "shelves/{shelf}"
112
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
+ # }
114
+ # name_descriptor: {
115
+ # pattern: "shelves/{shelf}"
116
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
+ # }
118
+ # };
119
+ # }
120
+ #
121
+ # The ResourceDescriptor Yaml config will look like:
122
+ #
123
+ # resources:
124
+ # - type: 'library.googleapis.com/Shelf'
125
+ # name_descriptor:
126
+ # - pattern: "shelves/{shelf}"
127
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
+ # - pattern: "shelves/{shelf}"
129
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
130
+ # @!attribute [rw] type
131
+ # @return [String]
132
+ # The resource type. It must be in the format of
133
+ # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be
134
+ # singular and must not include version numbers.
135
+ #
136
+ # Example: `storage.googleapis.com/Bucket`
137
+ #
138
+ # The value of the resource_type_kind must follow the regular expression
139
+ # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
140
+ # should use PascalCase (UpperCamelCase). The maximum number of
141
+ # characters allowed for the `resource_type_kind` is 100.
142
+ # @!attribute [rw] pattern
143
+ # @return [Array<String>]
144
+ # Optional. The relative resource name pattern associated with this resource
145
+ # type. The DNS prefix of the full resource name shouldn't be specified here.
146
+ #
147
+ # The path pattern must follow the syntax, which aligns with HTTP binding
148
+ # syntax:
149
+ #
150
+ # Template = Segment { "/" Segment } ;
151
+ # Segment = LITERAL | Variable ;
152
+ # Variable = "{" LITERAL "}" ;
153
+ #
154
+ # Examples:
155
+ #
156
+ # - "projects/\\{project}/topics/\\{topic}"
157
+ # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}"
158
+ #
159
+ # The components in braces correspond to the IDs for each resource in the
160
+ # hierarchy. It is expected that, if multiple patterns are provided,
161
+ # the same component name (e.g. "project") refers to IDs of the same
162
+ # type of resource.
163
+ # @!attribute [rw] name_field
164
+ # @return [String]
165
+ # Optional. The field on the resource that designates the resource name
166
+ # field. If omitted, this is assumed to be "name".
167
+ # @!attribute [rw] history
168
+ # @return [Google::Api::ResourceDescriptor::History]
169
+ # Optional. The historical or future-looking state of the resource pattern.
170
+ #
171
+ # Example:
172
+ #
173
+ # // The InspectTemplate message originally only supported resource
174
+ # // names with organization, and project was added later.
175
+ # message InspectTemplate {
176
+ # option (google.api.resource) = {
177
+ # type: "dlp.googleapis.com/InspectTemplate"
178
+ # pattern:
179
+ # "organizations/{organization}/inspectTemplates/{inspect_template}"
180
+ # pattern: "projects/{project}/inspectTemplates/{inspect_template}"
181
+ # history: ORIGINALLY_SINGLE_PATTERN
182
+ # };
183
+ # }
184
+ # @!attribute [rw] plural
185
+ # @return [String]
186
+ # The plural name used in the resource name, such as 'projects' for
187
+ # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
+ # field in k8s CRD spec
189
+ # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
190
+ # @!attribute [rw] singular
191
+ # @return [String]
192
+ # The same concept of the `singular` field in k8s CRD spec
193
+ # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
+ # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
195
+ class ResourceDescriptor
196
+ include Google::Protobuf::MessageExts
197
+ extend Google::Protobuf::MessageExts::ClassMethods
198
+
199
+ # A description of the historical or future-looking state of the
200
+ # resource pattern.
201
+ module History
202
+ # The "unset" value.
203
+ HISTORY_UNSPECIFIED = 0
204
+
205
+ # The resource originally had one pattern and launched as such, and
206
+ # additional patterns were added later.
207
+ ORIGINALLY_SINGLE_PATTERN = 1
208
+
209
+ # The resource has one pattern, but the API owner expects to add more
210
+ # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
211
+ # that from being necessary once there are multiple patterns.)
212
+ FUTURE_MULTI_PATTERN = 2
213
+ end
214
+ end
215
+
216
+ # Defines a proto annotation that describes a string field that refers to
217
+ # an API resource.
218
+ # @!attribute [rw] type
219
+ # @return [String]
220
+ # The resource type that the annotated field references.
221
+ #
222
+ # Example:
223
+ #
224
+ # message Subscription {
225
+ # string topic = 2 [(google.api.resource_reference) = {
226
+ # type: "pubsub.googleapis.com/Topic"
227
+ # }];
228
+ # }
229
+ # @!attribute [rw] child_type
230
+ # @return [String]
231
+ # The resource type of a child collection that the annotated field
232
+ # references. This is useful for annotating the `parent` field that
233
+ # doesn't have a fixed resource type.
234
+ #
235
+ # Example:
236
+ #
237
+ # message ListLogEntriesRequest {
238
+ # string parent = 1 [(google.api.resource_reference) = {
239
+ # child_type: "logging.googleapis.com/LogEntry"
240
+ # };
241
+ # }
242
+ class ResourceReference
243
+ include Google::Protobuf::MessageExts
244
+ extend Google::Protobuf::MessageExts::ClassMethods
245
+ end
246
+ end
247
+ end
@@ -0,0 +1,813 @@
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
+ # The top-level message sent by the client for the `Recognize` method.
25
+ # @!attribute [rw] config
26
+ # @return [Google::Cloud::Speech::V1p1beta1::RecognitionConfig]
27
+ # Required. Provides information to the recognizer that specifies how to
28
+ # process the request.
29
+ # @!attribute [rw] audio
30
+ # @return [Google::Cloud::Speech::V1p1beta1::RecognitionAudio]
31
+ # Required. The audio data to be recognized.
32
+ class RecognizeRequest
33
+ include Google::Protobuf::MessageExts
34
+ extend Google::Protobuf::MessageExts::ClassMethods
35
+ end
36
+
37
+ # The top-level message sent by the client for the `LongRunningRecognize`
38
+ # method.
39
+ # @!attribute [rw] config
40
+ # @return [Google::Cloud::Speech::V1p1beta1::RecognitionConfig]
41
+ # Required. Provides information to the recognizer that specifies how to
42
+ # process the request.
43
+ # @!attribute [rw] audio
44
+ # @return [Google::Cloud::Speech::V1p1beta1::RecognitionAudio]
45
+ # Required. The audio data to be recognized.
46
+ class LongRunningRecognizeRequest
47
+ include Google::Protobuf::MessageExts
48
+ extend Google::Protobuf::MessageExts::ClassMethods
49
+ end
50
+
51
+ # The top-level message sent by the client for the `StreamingRecognize` method.
52
+ # Multiple `StreamingRecognizeRequest` messages are sent. The first message
53
+ # must contain a `streaming_config` message and must not contain
54
+ # `audio_content`. All subsequent messages must contain `audio_content` and
55
+ # must not contain a `streaming_config` message.
56
+ # @!attribute [rw] streaming_config
57
+ # @return [Google::Cloud::Speech::V1p1beta1::StreamingRecognitionConfig]
58
+ # Provides information to the recognizer that specifies how to process the
59
+ # request. The first `StreamingRecognizeRequest` message must contain a
60
+ # `streaming_config` message.
61
+ # @!attribute [rw] audio_content
62
+ # @return [String]
63
+ # The audio data to be recognized. Sequential chunks of audio data are sent
64
+ # in sequential `StreamingRecognizeRequest` messages. The first
65
+ # `StreamingRecognizeRequest` message must not contain `audio_content` data
66
+ # and all subsequent `StreamingRecognizeRequest` messages must contain
67
+ # `audio_content` data. The audio bytes must be encoded as specified in
68
+ # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
69
+ # pure binary representation (not base64). See
70
+ # [content limits](https://cloud.google.com/speech-to-text/quotas#content).
71
+ class StreamingRecognizeRequest
72
+ include Google::Protobuf::MessageExts
73
+ extend Google::Protobuf::MessageExts::ClassMethods
74
+ end
75
+
76
+ # Provides information to the recognizer that specifies how to process the
77
+ # request.
78
+ # @!attribute [rw] config
79
+ # @return [Google::Cloud::Speech::V1p1beta1::RecognitionConfig]
80
+ # Required. Provides information to the recognizer that specifies how to
81
+ # process the request.
82
+ # @!attribute [rw] single_utterance
83
+ # @return [Boolean]
84
+ # If `false` or omitted, the recognizer will perform continuous
85
+ # recognition (continuing to wait for and process audio even if the user
86
+ # pauses speaking) until the client closes the input stream (gRPC API) or
87
+ # until the maximum time limit has been reached. May return multiple
88
+ # `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
89
+ #
90
+ # If `true`, the recognizer will detect a single spoken utterance. When it
91
+ # detects that the user has paused or stopped speaking, it will return an
92
+ # `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
93
+ # more than one `StreamingRecognitionResult` with the `is_final` flag set to
94
+ # `true`.
95
+ # @!attribute [rw] interim_results
96
+ # @return [Boolean]
97
+ # If `true`, interim results (tentative hypotheses) may be
98
+ # returned as they become available (these interim results are indicated with
99
+ # the `is_final=false` flag).
100
+ # If `false` or omitted, only `is_final=true` result(s) are returned.
101
+ class StreamingRecognitionConfig
102
+ include Google::Protobuf::MessageExts
103
+ extend Google::Protobuf::MessageExts::ClassMethods
104
+ end
105
+
106
+ # Provides information to the recognizer that specifies how to process the
107
+ # request.
108
+ # @!attribute [rw] encoding
109
+ # @return [Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding]
110
+ # Encoding of audio data sent in all `RecognitionAudio` messages.
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}.
113
+ # @!attribute [rw] sample_rate_hertz
114
+ # @return [Integer]
115
+ # Sample rate in Hertz of the audio data sent in all
116
+ # `RecognitionAudio` messages. Valid values are: 8000-48000.
117
+ # 16000 is optimal. For best results, set the sampling rate of the audio
118
+ # source to 16000 Hz. If that's not possible, use the native sample rate of
119
+ # the audio source (instead of re-sampling).
120
+ # 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
+ # @!attribute [rw] audio_channel_count
123
+ # @return [Integer]
124
+ # The number of channels in the input audio data.
125
+ # ONLY set this for MULTI-CHANNEL recognition.
126
+ # Valid values for LINEAR16 and FLAC are `1`-`8`.
127
+ # Valid values for OGG_OPUS are '1'-'254'.
128
+ # Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
129
+ # If `0` or omitted, defaults to one channel (mono).
130
+ # Note: We only recognize the first channel by default.
131
+ # To perform independent recognition on each channel set
132
+ # `enable_separate_recognition_per_channel` to 'true'.
133
+ # @!attribute [rw] enable_separate_recognition_per_channel
134
+ # @return [Boolean]
135
+ # This needs to be set to `true` explicitly and `audio_channel_count` > 1
136
+ # to get each channel recognized separately. The recognition result will
137
+ # contain a `channel_tag` field to state which channel that result belongs
138
+ # to. If this is not true, we will only recognize the first channel. The
139
+ # request is billed cumulatively for all channels recognized:
140
+ # `audio_channel_count` multiplied by the length of the audio.
141
+ # @!attribute [rw] language_code
142
+ # @return [String]
143
+ # Required. The language of the supplied audio as a
144
+ # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
145
+ # Example: "en-US".
146
+ # See [Language
147
+ # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
148
+ # of the currently supported language codes.
149
+ # @!attribute [rw] alternative_language_codes
150
+ # @return [Array<String>]
151
+ # A list of up to 3 additional
152
+ # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
153
+ # listing possible alternative languages of the supplied audio.
154
+ # See [Language
155
+ # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
156
+ # of the currently supported language codes. If alternative languages are
157
+ # listed, recognition result will contain recognition in the most likely
158
+ # language detected including the main language_code. The recognition result
159
+ # will include the language tag of the language detected in the audio. Note:
160
+ # This feature is only supported for Voice Command and Voice Search use cases
161
+ # and performance may vary for other use cases (e.g., phone call
162
+ # transcription).
163
+ # @!attribute [rw] max_alternatives
164
+ # @return [Integer]
165
+ # Maximum number of recognition hypotheses to be returned.
166
+ # Specifically, the maximum number of `SpeechRecognitionAlternative` messages
167
+ # within each `SpeechRecognitionResult`.
168
+ # The server may return fewer than `max_alternatives`.
169
+ # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
170
+ # one. If omitted, will return a maximum of one.
171
+ # @!attribute [rw] profanity_filter
172
+ # @return [Boolean]
173
+ # If set to `true`, the server will attempt to filter out
174
+ # 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.
177
+ # @!attribute [rw] speech_contexts
178
+ # @return [Array<Google::Cloud::Speech::V1p1beta1::SpeechContext>]
179
+ # Array of {Google::Cloud::Speech::V1p1beta1::SpeechContext SpeechContext}.
180
+ # A means to provide context to assist the speech recognition. For more
181
+ # information, see
182
+ # [speech
183
+ # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
184
+ # @!attribute [rw] enable_word_time_offsets
185
+ # @return [Boolean]
186
+ # If `true`, the top result includes a list of words and
187
+ # the start and end time offsets (timestamps) for those words. If
188
+ # `false`, no word-level time offset information is returned. The default is
189
+ # `false`.
190
+ # @!attribute [rw] enable_word_confidence
191
+ # @return [Boolean]
192
+ # If `true`, the top result includes a list of words and the
193
+ # confidence for those words. If `false`, no word-level confidence
194
+ # information is returned. The default is `false`.
195
+ # @!attribute [rw] enable_automatic_punctuation
196
+ # @return [Boolean]
197
+ # If 'true', adds punctuation to recognition result hypotheses.
198
+ # This feature is only available in select languages. Setting this for
199
+ # requests in other languages has no effect at all.
200
+ # 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
+ # @!attribute [rw] enable_speaker_diarization
205
+ # @return [Boolean]
206
+ # If 'true', enables speaker detection for each recognized word in
207
+ # the top alternative of the recognition result using a speaker_tag provided
208
+ # in the WordInfo.
209
+ # Note: Use diarization_config instead.
210
+ # @!attribute [rw] diarization_speaker_count
211
+ # @return [Integer]
212
+ # If set, specifies the estimated number of speakers in the conversation.
213
+ # Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
214
+ # Note: Use diarization_config instead.
215
+ # @!attribute [rw] diarization_config
216
+ # @return [Google::Cloud::Speech::V1p1beta1::SpeakerDiarizationConfig]
217
+ # Config to enable speaker diarization and set additional
218
+ # parameters to make diarization better suited for your application.
219
+ # Note: When this is enabled, we send all the words from the beginning of the
220
+ # audio for the top alternative in every consecutive STREAMING responses.
221
+ # This is done in order to improve our speaker tags as our models learn to
222
+ # identify the speakers in the conversation over time.
223
+ # For non-streaming requests, the diarization results will be provided only
224
+ # in the top alternative of the FINAL SpeechRecognitionResult.
225
+ # @!attribute [rw] metadata
226
+ # @return [Google::Cloud::Speech::V1p1beta1::RecognitionMetadata]
227
+ # Metadata regarding this request.
228
+ # @!attribute [rw] model
229
+ # @return [String]
230
+ # Which model to select for the given request. Select the model
231
+ # best suited to your domain to get best results. If a model is not
232
+ # explicitly specified, then we auto-select a model based on the parameters
233
+ # in the RecognitionConfig.
234
+ # <table>
235
+ # <tr>
236
+ # <td><b>Model</b></td>
237
+ # <td><b>Description</b></td>
238
+ # </tr>
239
+ # <tr>
240
+ # <td><code>command_and_search</code></td>
241
+ # <td>Best for short queries such as voice commands or voice search.</td>
242
+ # </tr>
243
+ # <tr>
244
+ # <td><code>phone_call</code></td>
245
+ # <td>Best for audio that originated from a phone call (typically
246
+ # recorded at an 8khz sampling rate).</td>
247
+ # </tr>
248
+ # <tr>
249
+ # <td><code>video</code></td>
250
+ # <td>Best for audio that originated from from video or includes multiple
251
+ # speakers. Ideally the audio is recorded at a 16khz or greater
252
+ # sampling rate. This is a premium model that costs more than the
253
+ # standard rate.</td>
254
+ # </tr>
255
+ # <tr>
256
+ # <td><code>default</code></td>
257
+ # <td>Best for audio that is not one of the specific audio models.
258
+ # For example, long-form audio. Ideally the audio is high-fidelity,
259
+ # recorded at a 16khz or greater sampling rate.</td>
260
+ # </tr>
261
+ # </table>
262
+ # @!attribute [rw] use_enhanced
263
+ # @return [Boolean]
264
+ # Set to true to use an enhanced model for speech recognition.
265
+ # If `use_enhanced` is set to true and the `model` field is not set, then
266
+ # an appropriate enhanced model is chosen if an enhanced model exists for
267
+ # the audio.
268
+ #
269
+ # If `use_enhanced` is true and an enhanced version of the specified model
270
+ # does not exist, then the speech is recognized using the standard version
271
+ # of the specified model.
272
+ class RecognitionConfig
273
+ include Google::Protobuf::MessageExts
274
+ extend Google::Protobuf::MessageExts::ClassMethods
275
+
276
+ # The encoding of the audio data sent in the request.
277
+ #
278
+ # All encodings support only 1 channel (mono) audio, unless the
279
+ # `audio_channel_count` and `enable_separate_recognition_per_channel` fields
280
+ # are set.
281
+ #
282
+ # For best results, the audio source should be captured and transmitted using
283
+ # a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
284
+ # recognition can be reduced if lossy codecs are used to capture or transmit
285
+ # audio, particularly if background noise is present. Lossy codecs include
286
+ # `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, and `MP3`.
287
+ #
288
+ # The `FLAC` and `WAV` audio file formats include a header that describes the
289
+ # included audio content. You can request recognition for `WAV` files that
290
+ # contain either `LINEAR16` or `MULAW` encoded audio.
291
+ # If you send `FLAC` or `WAV` audio file format in
292
+ # your request, you do not need to specify an `AudioEncoding`; the audio
293
+ # encoding format is determined from the file header. If you specify
294
+ # an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the
295
+ # encoding configuration must match the encoding described in the audio
296
+ # header; otherwise the request returns an
297
+ # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code.
298
+ module AudioEncoding
299
+ # Not specified.
300
+ ENCODING_UNSPECIFIED = 0
301
+
302
+ # Uncompressed 16-bit signed little-endian samples (Linear PCM).
303
+ LINEAR16 = 1
304
+
305
+ # `FLAC` (Free Lossless Audio
306
+ # Codec) is the recommended encoding because it is
307
+ # lossless--therefore recognition is not compromised--and
308
+ # requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
309
+ # encoding supports 16-bit and 24-bit samples, however, not all fields in
310
+ # `STREAMINFO` are supported.
311
+ FLAC = 2
312
+
313
+ # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
314
+ MULAW = 3
315
+
316
+ # Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
317
+ AMR = 4
318
+
319
+ # Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
320
+ AMR_WB = 5
321
+
322
+ # Opus encoded audio frames in Ogg container
323
+ # ([OggOpus](https://wiki.xiph.org/OggOpus)).
324
+ # `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
325
+ OGG_OPUS = 6
326
+
327
+ # Although the use of lossy encodings is not recommended, if a very low
328
+ # bitrate encoding is required, `OGG_OPUS` is highly preferred over
329
+ # Speex encoding. The [Speex](https://speex.org/) encoding supported by
330
+ # Cloud Speech API has a header byte in each block, as in MIME type
331
+ # `audio/x-speex-with-header-byte`.
332
+ # It is a variant of the RTP Speex encoding defined in
333
+ # [RFC 5574](https://tools.ietf.org/html/rfc5574).
334
+ # The stream is a sequence of blocks, one block per RTP packet. Each block
335
+ # starts with a byte containing the length of the block, in bytes, followed
336
+ # by one or more frames of Speex data, padded to an integral number of
337
+ # bytes (octets) as specified in RFC 5574. In other words, each RTP header
338
+ # is replaced with a single byte containing the block length. Only Speex
339
+ # wideband is supported. `sample_rate_hertz` must be 16000.
340
+ SPEEX_WITH_HEADER_BYTE = 7
341
+
342
+ # 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.
345
+ MP3 = 8
346
+ end
347
+ end
348
+
349
+ # Config to enable speaker diarization.
350
+ # @!attribute [rw] enable_speaker_diarization
351
+ # @return [Boolean]
352
+ # If 'true', enables speaker detection for each recognized word in
353
+ # the top alternative of the recognition result using a speaker_tag provided
354
+ # in the WordInfo.
355
+ # @!attribute [rw] min_speaker_count
356
+ # @return [Integer]
357
+ # Minimum number of speakers in the conversation. This range gives you more
358
+ # flexibility by allowing the system to automatically determine the correct
359
+ # number of speakers. If not set, the default value is 2.
360
+ # @!attribute [rw] max_speaker_count
361
+ # @return [Integer]
362
+ # Maximum number of speakers in the conversation. This range gives you more
363
+ # flexibility by allowing the system to automatically determine the correct
364
+ # number of speakers. If not set, the default value is 6.
365
+ class SpeakerDiarizationConfig
366
+ include Google::Protobuf::MessageExts
367
+ extend Google::Protobuf::MessageExts::ClassMethods
368
+ end
369
+
370
+ # Description of audio data to be recognized.
371
+ # @!attribute [rw] interaction_type
372
+ # @return [Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::InteractionType]
373
+ # The use case most closely describing the audio content to be recognized.
374
+ # @!attribute [rw] industry_naics_code_of_audio
375
+ # @return [Integer]
376
+ # The industry vertical to which this speech recognition request most
377
+ # closely applies. This is most indicative of the topics contained
378
+ # in the audio. Use the 6-digit NAICS code to identify the industry
379
+ # vertical - see https://www.naics.com/search/.
380
+ # @!attribute [rw] microphone_distance
381
+ # @return [Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::MicrophoneDistance]
382
+ # The audio type that most closely describes the audio being recognized.
383
+ # @!attribute [rw] original_media_type
384
+ # @return [Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::OriginalMediaType]
385
+ # The original media the speech was recorded on.
386
+ # @!attribute [rw] recording_device_type
387
+ # @return [Google::Cloud::Speech::V1p1beta1::RecognitionMetadata::RecordingDeviceType]
388
+ # The type of device the speech was recorded with.
389
+ # @!attribute [rw] recording_device_name
390
+ # @return [String]
391
+ # The device used to make the recording. Examples 'Nexus 5X' or
392
+ # 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
393
+ # 'Cardioid Microphone'.
394
+ # @!attribute [rw] original_mime_type
395
+ # @return [String]
396
+ # Mime type of the original audio file. For example `audio/m4a`,
397
+ # `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
398
+ # A list of possible audio mime types is maintained at
399
+ # http://www.iana.org/assignments/media-types/media-types.xhtml#audio
400
+ # @!attribute [rw] obfuscated_id
401
+ # @return [Integer]
402
+ # Obfuscated (privacy-protected) ID of the user, to identify number of
403
+ # unique users using the service.
404
+ # @!attribute [rw] audio_topic
405
+ # @return [String]
406
+ # Description of the content. Eg. "Recordings of federal supreme court
407
+ # hearings from 2012".
408
+ class RecognitionMetadata
409
+ include Google::Protobuf::MessageExts
410
+ extend Google::Protobuf::MessageExts::ClassMethods
411
+
412
+ # Use case categories that the audio recognition request can be described
413
+ # by.
414
+ module InteractionType
415
+ # Use case is either unknown or is something other than one of the other
416
+ # values below.
417
+ INTERACTION_TYPE_UNSPECIFIED = 0
418
+
419
+ # Multiple people in a conversation or discussion. For example in a
420
+ # meeting with two or more people actively participating. Typically
421
+ # all the primary people speaking would be in the same room (if not,
422
+ # see PHONE_CALL)
423
+ DISCUSSION = 1
424
+
425
+ # One or more persons lecturing or presenting to others, mostly
426
+ # uninterrupted.
427
+ PRESENTATION = 2
428
+
429
+ # A phone-call or video-conference in which two or more people, who are
430
+ # not in the same room, are actively participating.
431
+ PHONE_CALL = 3
432
+
433
+ # A recorded message intended for another person to listen to.
434
+ VOICEMAIL = 4
435
+
436
+ # Professionally produced audio (eg. TV Show, Podcast).
437
+ PROFESSIONALLY_PRODUCED = 5
438
+
439
+ # Transcribe spoken questions and queries into text.
440
+ VOICE_SEARCH = 6
441
+
442
+ # Transcribe voice commands, such as for controlling a device.
443
+ VOICE_COMMAND = 7
444
+
445
+ # Transcribe speech to text to create a written document, such as a
446
+ # text-message, email or report.
447
+ DICTATION = 8
448
+ end
449
+
450
+ # Enumerates the types of capture settings describing an audio file.
451
+ module MicrophoneDistance
452
+ # Audio type is not known.
453
+ MICROPHONE_DISTANCE_UNSPECIFIED = 0
454
+
455
+ # The audio was captured from a closely placed microphone. Eg. phone,
456
+ # dictaphone, or handheld microphone. Generally if there speaker is within
457
+ # 1 meter of the microphone.
458
+ NEARFIELD = 1
459
+
460
+ # The speaker if within 3 meters of the microphone.
461
+ MIDFIELD = 2
462
+
463
+ # The speaker is more than 3 meters away from the microphone.
464
+ FARFIELD = 3
465
+ end
466
+
467
+ # The original media the speech was recorded on.
468
+ module OriginalMediaType
469
+ # Unknown original media type.
470
+ ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0
471
+
472
+ # The speech data is an audio recording.
473
+ AUDIO = 1
474
+
475
+ # The speech data originally recorded on a video.
476
+ VIDEO = 2
477
+ end
478
+
479
+ # The type of device the speech was recorded with.
480
+ module RecordingDeviceType
481
+ # The recording device is unknown.
482
+ RECORDING_DEVICE_TYPE_UNSPECIFIED = 0
483
+
484
+ # Speech was recorded on a smartphone.
485
+ SMARTPHONE = 1
486
+
487
+ # Speech was recorded using a personal computer or tablet.
488
+ PC = 2
489
+
490
+ # Speech was recorded over a phone line.
491
+ PHONE_LINE = 3
492
+
493
+ # Speech was recorded in a vehicle.
494
+ VEHICLE = 4
495
+
496
+ # Speech was recorded outdoors.
497
+ OTHER_OUTDOOR_DEVICE = 5
498
+
499
+ # Speech was recorded indoors.
500
+ OTHER_INDOOR_DEVICE = 6
501
+ end
502
+ end
503
+
504
+ # Provides "hints" to the speech recognizer to favor specific words and phrases
505
+ # in the results.
506
+ # @!attribute [rw] phrases
507
+ # @return [Array<String>]
508
+ # A list of strings containing words and phrases "hints" so that
509
+ # the speech recognition is more likely to recognize them. This can be used
510
+ # to improve the accuracy for specific words and phrases, for example, if
511
+ # specific commands are typically spoken by the user. This can also be used
512
+ # to add additional words to the vocabulary of the recognizer. See
513
+ # [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
514
+ #
515
+ # List items can also be set to classes for groups of words that represent
516
+ # common concepts that occur in natural language. For example, rather than
517
+ # providing phrase hints for every month of the year, using the $MONTH class
518
+ # improves the likelihood of correctly transcribing audio that includes
519
+ # months.
520
+ # @!attribute [rw] boost
521
+ # @return [Float]
522
+ # Hint Boost. Positive value will increase the probability that a specific
523
+ # phrase will be recognized over other similar sounding phrases. The higher
524
+ # the boost, the higher the chance of false positive recognition as well.
525
+ # Negative boost values would correspond to anti-biasing. Anti-biasing is not
526
+ # enabled, so negative boost will simply be ignored. Though `boost` can
527
+ # accept a wide range of positive values, most use cases are best served with
528
+ # values between 0 and 20. We recommend using a binary search approach to
529
+ # finding the optimal value for your use case.
530
+ class SpeechContext
531
+ include Google::Protobuf::MessageExts
532
+ extend Google::Protobuf::MessageExts::ClassMethods
533
+ end
534
+
535
+ # Contains audio data in the encoding specified in the `RecognitionConfig`.
536
+ # 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).
539
+ # @!attribute [rw] content
540
+ # @return [String]
541
+ # The audio data bytes encoded as specified in
542
+ # `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
543
+ # pure binary representation, whereas JSON representations use base64.
544
+ # @!attribute [rw] uri
545
+ # @return [String]
546
+ # URI that points to a file that contains audio data bytes as specified in
547
+ # `RecognitionConfig`. The file must not be compressed (for example, gzip).
548
+ # Currently, only Google Cloud Storage URIs are
549
+ # supported, which must be specified in the following format:
550
+ # `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).
553
+ class RecognitionAudio
554
+ include Google::Protobuf::MessageExts
555
+ extend Google::Protobuf::MessageExts::ClassMethods
556
+ end
557
+
558
+ # The only message returned to the client by the `Recognize` method. It
559
+ # contains the result as zero or more sequential `SpeechRecognitionResult`
560
+ # messages.
561
+ # @!attribute [rw] results
562
+ # @return [Array<Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>]
563
+ # Sequential list of transcription results corresponding to
564
+ # sequential portions of audio.
565
+ class RecognizeResponse
566
+ include Google::Protobuf::MessageExts
567
+ extend Google::Protobuf::MessageExts::ClassMethods
568
+ end
569
+
570
+ # The only message returned to the client by the `LongRunningRecognize` method.
571
+ # It contains the result as zero or more sequential `SpeechRecognitionResult`
572
+ # messages. It is included in the `result.response` field of the `Operation`
573
+ # returned by the `GetOperation` call of the `google::longrunning::Operations`
574
+ # service.
575
+ # @!attribute [rw] results
576
+ # @return [Array<Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>]
577
+ # Sequential list of transcription results corresponding to
578
+ # sequential portions of audio.
579
+ class LongRunningRecognizeResponse
580
+ include Google::Protobuf::MessageExts
581
+ extend Google::Protobuf::MessageExts::ClassMethods
582
+ end
583
+
584
+ # Describes the progress of a long-running `LongRunningRecognize` call. It is
585
+ # included in the `metadata` field of the `Operation` returned by the
586
+ # `GetOperation` call of the `google::longrunning::Operations` service.
587
+ # @!attribute [rw] progress_percent
588
+ # @return [Integer]
589
+ # Approximate percentage of audio processed thus far. Guaranteed to be 100
590
+ # when the audio is fully processed and the results are available.
591
+ # @!attribute [rw] start_time
592
+ # @return [Google::Protobuf::Timestamp]
593
+ # Time when the request was received.
594
+ # @!attribute [rw] last_update_time
595
+ # @return [Google::Protobuf::Timestamp]
596
+ # Time of the most recent processing update.
597
+ class LongRunningRecognizeMetadata
598
+ include Google::Protobuf::MessageExts
599
+ extend Google::Protobuf::MessageExts::ClassMethods
600
+ end
601
+
602
+ # `StreamingRecognizeResponse` is the only message returned to the client by
603
+ # `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
604
+ # messages are streamed back to the client. If there is no recognizable
605
+ # audio, and `single_utterance` is set to false, then no messages are streamed
606
+ # back to the client.
607
+ #
608
+ # Here's an example of a series of ten `StreamingRecognizeResponse`s that might
609
+ # be returned while processing audio:
610
+ #
611
+ # 1. results { alternatives { transcript: "tube" } stability: 0.01 }
612
+ #
613
+ # 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
614
+ #
615
+ # 3. results { alternatives { transcript: "to be" } stability: 0.9 }
616
+ # results { alternatives { transcript: " or not to be" } stability: 0.01 }
617
+ #
618
+ # 4. results { alternatives { transcript: "to be or not to be"
619
+ # confidence: 0.92 }
620
+ # alternatives { transcript: "to bee or not to bee" }
621
+ # is_final: true }
622
+ #
623
+ # 5. results { alternatives { transcript: " that's" } stability: 0.01 }
624
+ #
625
+ # 6. results { alternatives { transcript: " that is" } stability: 0.9 }
626
+ # results { alternatives { transcript: " the question" } stability: 0.01 }
627
+ #
628
+ # 7. results { alternatives { transcript: " that is the question"
629
+ # confidence: 0.98 }
630
+ # alternatives { transcript: " that was the question" }
631
+ # is_final: true }
632
+ #
633
+ # Notes:
634
+ #
635
+ # - Only two of the above responses #4 and #7 contain final results; they are
636
+ # indicated by `is_final: true`. Concatenating these together generates the
637
+ # full transcript: "to be or not to be that is the question".
638
+ #
639
+ # - The others contain interim `results`. #3 and #6 contain two interim
640
+ # `results`: the first portion has a high stability and is less likely to
641
+ # change; the second portion has a low stability and is very likely to
642
+ # change. A UI designer might choose to show only high stability `results`.
643
+ #
644
+ # - The specific `stability` and `confidence` values shown above are only for
645
+ # illustrative purposes. Actual values may vary.
646
+ #
647
+ # - In each response, only one of these fields will be set:
648
+ # `error`,
649
+ # `speech_event_type`, or
650
+ # one or more (repeated) `results`.
651
+ # @!attribute [rw] error
652
+ # @return [Google::Rpc::Status]
653
+ # If set, returns a {Google::Rpc::Status google.rpc.Status} message that
654
+ # specifies the error for the operation.
655
+ # @!attribute [rw] results
656
+ # @return [Array<Google::Cloud::Speech::V1p1beta1::StreamingRecognitionResult>]
657
+ # This repeated list contains zero or more results that
658
+ # correspond to consecutive portions of the audio currently being processed.
659
+ # It contains zero or one `is_final=true` result (the newly settled portion),
660
+ # followed by zero or more `is_final=false` results (the interim results).
661
+ # @!attribute [rw] speech_event_type
662
+ # @return [Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse::SpeechEventType]
663
+ # Indicates the type of speech event.
664
+ class StreamingRecognizeResponse
665
+ include Google::Protobuf::MessageExts
666
+ extend Google::Protobuf::MessageExts::ClassMethods
667
+
668
+ # Indicates the type of speech event.
669
+ module SpeechEventType
670
+ # No speech event specified.
671
+ SPEECH_EVENT_UNSPECIFIED = 0
672
+
673
+ # This event indicates that the server has detected the end of the user's
674
+ # speech utterance and expects no additional speech. Therefore, the server
675
+ # will not process additional audio (although it may subsequently return
676
+ # additional results). The client should stop sending additional audio
677
+ # data, half-close the gRPC connection, and wait for any additional results
678
+ # until the server closes the gRPC connection. This event is only sent if
679
+ # `single_utterance` was set to `true`, and is not used otherwise.
680
+ END_OF_SINGLE_UTTERANCE = 1
681
+ end
682
+ end
683
+
684
+ # A streaming speech recognition result corresponding to a portion of the audio
685
+ # that is currently being processed.
686
+ # @!attribute [rw] alternatives
687
+ # @return [Array<Google::Cloud::Speech::V1p1beta1::SpeechRecognitionAlternative>]
688
+ # May contain one or more recognition hypotheses (up to the
689
+ # maximum specified in `max_alternatives`).
690
+ # These alternatives are ordered in terms of accuracy, with the top (first)
691
+ # alternative being the most probable, as ranked by the recognizer.
692
+ # @!attribute [rw] is_final
693
+ # @return [Boolean]
694
+ # If `false`, this `StreamingRecognitionResult` represents an
695
+ # interim result that may change. If `true`, this is the final time the
696
+ # speech service will return this particular `StreamingRecognitionResult`,
697
+ # the recognizer will not return any further hypotheses for this portion of
698
+ # the transcript and corresponding audio.
699
+ # @!attribute [rw] stability
700
+ # @return [Float]
701
+ # An estimate of the likelihood that the recognizer will not
702
+ # change its guess about this interim result. Values range from 0.0
703
+ # (completely unstable) to 1.0 (completely stable).
704
+ # This field is only provided for interim results (`is_final=false`).
705
+ # The default of 0.0 is a sentinel value indicating `stability` was not set.
706
+ # @!attribute [rw] result_end_time
707
+ # @return [Google::Protobuf::Duration]
708
+ # Time offset of the end of this result relative to the
709
+ # beginning of the audio.
710
+ # @!attribute [rw] channel_tag
711
+ # @return [Integer]
712
+ # For multi-channel audio, this is the channel number corresponding to the
713
+ # recognized result for the audio from that channel.
714
+ # 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.
720
+ class StreamingRecognitionResult
721
+ include Google::Protobuf::MessageExts
722
+ extend Google::Protobuf::MessageExts::ClassMethods
723
+ end
724
+
725
+ # A speech recognition result corresponding to a portion of the audio.
726
+ # @!attribute [rw] alternatives
727
+ # @return [Array<Google::Cloud::Speech::V1p1beta1::SpeechRecognitionAlternative>]
728
+ # May contain one or more recognition hypotheses (up to the
729
+ # maximum specified in `max_alternatives`).
730
+ # These alternatives are ordered in terms of accuracy, with the top (first)
731
+ # alternative being the most probable, as ranked by the recognizer.
732
+ # @!attribute [rw] channel_tag
733
+ # @return [Integer]
734
+ # 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
+ # @!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.
742
+ class SpeechRecognitionResult
743
+ include Google::Protobuf::MessageExts
744
+ extend Google::Protobuf::MessageExts::ClassMethods
745
+ end
746
+
747
+ # Alternative hypotheses (a.k.a. n-best list).
748
+ # @!attribute [rw] transcript
749
+ # @return [String]
750
+ # Transcript text representing the words that the user spoke.
751
+ # @!attribute [rw] confidence
752
+ # @return [Float]
753
+ # The confidence estimate between 0.0 and 1.0. A higher number
754
+ # indicates an estimated greater likelihood that the recognized words are
755
+ # correct. This field is set only for the top alternative of a non-streaming
756
+ # result or, of a streaming result where `is_final=true`.
757
+ # This field is not guaranteed to be accurate and users should not rely on it
758
+ # to be always provided.
759
+ # The default of 0.0 is a sentinel value indicating `confidence` was not set.
760
+ # @!attribute [rw] words
761
+ # @return [Array<Google::Cloud::Speech::V1p1beta1::WordInfo>]
762
+ # A list of word-specific information for each recognized word.
763
+ # Note: When `enable_speaker_diarization` is true, you will see all the words
764
+ # from the beginning of the audio.
765
+ class SpeechRecognitionAlternative
766
+ include Google::Protobuf::MessageExts
767
+ extend Google::Protobuf::MessageExts::ClassMethods
768
+ end
769
+
770
+ # Word-specific information for recognized words.
771
+ # @!attribute [rw] start_time
772
+ # @return [Google::Protobuf::Duration]
773
+ # Time offset relative to the beginning of the audio,
774
+ # and corresponding to the start of the spoken word.
775
+ # This field is only set if `enable_word_time_offsets=true` and only
776
+ # in the top hypothesis.
777
+ # This is an experimental feature and the accuracy of the time offset can
778
+ # vary.
779
+ # @!attribute [rw] end_time
780
+ # @return [Google::Protobuf::Duration]
781
+ # Time offset relative to the beginning of the audio,
782
+ # and corresponding to the end of the spoken word.
783
+ # This field is only set if `enable_word_time_offsets=true` and only
784
+ # in the top hypothesis.
785
+ # This is an experimental feature and the accuracy of the time offset can
786
+ # vary.
787
+ # @!attribute [rw] word
788
+ # @return [String]
789
+ # The word corresponding to this set of information.
790
+ # @!attribute [rw] confidence
791
+ # @return [Float]
792
+ # The confidence estimate between 0.0 and 1.0. A higher number
793
+ # indicates an estimated greater likelihood that the recognized words are
794
+ # correct. This field is set only for the top alternative of a non-streaming
795
+ # result or, of a streaming result where `is_final=true`.
796
+ # This field is not guaranteed to be accurate and users should not rely on it
797
+ # to be always provided.
798
+ # 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
802
+ # the audio. This field specifies which one of those speakers was detected to
803
+ # have spoken this word. Value ranges from '1' to diarization_speaker_count.
804
+ # speaker_tag is set if enable_speaker_diarization = 'true' and only in the
805
+ # top alternative.
806
+ class WordInfo
807
+ include Google::Protobuf::MessageExts
808
+ extend Google::Protobuf::MessageExts::ClassMethods
809
+ end
810
+ end
811
+ end
812
+ end
813
+ end