google-cloud-speech 0.41.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/AUTHENTICATION.md +51 -59
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +307 -0
  6. data/README.md +35 -49
  7. data/lib/google-cloud-speech.rb +19 -0
  8. data/lib/google/cloud/speech.rb +81 -142
  9. data/lib/google/cloud/speech/version.rb +1 -1
  10. metadata +103 -67
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/speech/v1.rb +0 -166
  13. data/lib/google/cloud/speech/v1/cloud_speech_pb.rb +0 -192
  14. data/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb +0 -58
  15. data/lib/google/cloud/speech/v1/credentials.rb +0 -41
  16. data/lib/google/cloud/speech/v1/doc/google/cloud/speech/v1/cloud_speech.rb +0 -698
  17. data/lib/google/cloud/speech/v1/doc/google/longrunning/operations.rb +0 -51
  18. data/lib/google/cloud/speech/v1/doc/google/protobuf/any.rb +0 -131
  19. data/lib/google/cloud/speech/v1/doc/google/protobuf/duration.rb +0 -91
  20. data/lib/google/cloud/speech/v1/doc/google/rpc/status.rb +0 -39
  21. data/lib/google/cloud/speech/v1/helpers.rb +0 -136
  22. data/lib/google/cloud/speech/v1/speech_client.rb +0 -346
  23. data/lib/google/cloud/speech/v1/speech_client_config.json +0 -41
  24. data/lib/google/cloud/speech/v1/stream.rb +0 -615
  25. data/lib/google/cloud/speech/v1p1beta1.rb +0 -166
  26. data/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb +0 -200
  27. data/lib/google/cloud/speech/v1p1beta1/cloud_speech_services_pb.rb +0 -58
  28. data/lib/google/cloud/speech/v1p1beta1/credentials.rb +0 -41
  29. data/lib/google/cloud/speech/v1p1beta1/doc/google/cloud/speech/v1p1beta1/cloud_speech.rb +0 -758
  30. data/lib/google/cloud/speech/v1p1beta1/doc/google/longrunning/operations.rb +0 -51
  31. data/lib/google/cloud/speech/v1p1beta1/doc/google/protobuf/any.rb +0 -131
  32. data/lib/google/cloud/speech/v1p1beta1/doc/google/protobuf/duration.rb +0 -91
  33. data/lib/google/cloud/speech/v1p1beta1/doc/google/rpc/status.rb +0 -39
  34. data/lib/google/cloud/speech/v1p1beta1/helpers.rb +0 -136
  35. data/lib/google/cloud/speech/v1p1beta1/speech_client.rb +0 -346
  36. data/lib/google/cloud/speech/v1p1beta1/speech_client_config.json +0 -41
  37. data/lib/google/cloud/speech/v1p1beta1/stream.rb +0 -615
@@ -1,166 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "google/cloud/speech/v1p1beta1/speech_client"
17
- require "google/cloud/speech/v1p1beta1/helpers"
18
- require "google/cloud/speech/v1p1beta1/cloud_speech_pb"
19
-
20
- module Google
21
- module Cloud
22
- module Speech
23
- # rubocop:disable LineLength
24
-
25
- ##
26
- # # Ruby Client for Cloud Speech-to-Text API
27
- #
28
- # [Cloud Speech-to-Text API][Product Documentation]:
29
- # Converts audio to text by applying powerful neural network models.
30
- # - [Product Documentation][]
31
- #
32
- # ## Quick Start
33
- # In order to use this library, you first need to go through the following
34
- # steps:
35
- #
36
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
37
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
38
- # 3. [Enable the Cloud Speech-to-Text API.](https://console.cloud.google.com/apis/library/speech.googleapis.com)
39
- # 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-speech/latest/file.AUTHENTICATION.html)
40
- #
41
- # ### Installation
42
- # ```
43
- # $ gem install google-cloud-speech
44
- # ```
45
- #
46
- # ### Preview
47
- # #### SpeechClient
48
- # ```rb
49
- # require "google/cloud/speech"
50
- #
51
- # speech_client = Google::Cloud::Speech.new(version: :v1p1beta1)
52
- # language_code = "en-US"
53
- # sample_rate_hertz = 44100
54
- # encoding = :FLAC
55
- # config = {
56
- # language_code: language_code,
57
- # sample_rate_hertz: sample_rate_hertz,
58
- # encoding: encoding
59
- # }
60
- # uri = "gs://cloud-samples-data/speech/brooklyn_bridge.flac"
61
- # audio = { uri: uri }
62
- # response = speech_client.recognize(config, audio)
63
- # ```
64
- #
65
- # ### Next Steps
66
- # - Read the [Cloud Speech-to-Text API Product documentation][Product Documentation]
67
- # to learn more about the product and see How-to Guides.
68
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
69
- # to see the full list of Cloud APIs that we cover.
70
- #
71
- # [Product Documentation]: https://cloud.google.com/speech
72
- #
73
- # ## Enabling Logging
74
- #
75
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
76
- # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
77
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
78
- # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
79
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
80
- #
81
- # Configuring a Ruby stdlib logger:
82
- #
83
- # ```ruby
84
- # require "logger"
85
- #
86
- # module MyLogger
87
- # LOGGER = Logger.new $stderr, level: Logger::WARN
88
- # def logger
89
- # LOGGER
90
- # end
91
- # end
92
- #
93
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
94
- # module GRPC
95
- # extend MyLogger
96
- # end
97
- # ```
98
- #
99
- module V1p1beta1
100
- # rubocop:enable LineLength
101
-
102
- ##
103
- # Service that implements Google Cloud Speech API.
104
- #
105
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
106
- # Provides the means for authenticating requests made by the client. This parameter can
107
- # be many types.
108
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
109
- # authenticating requests made by this client.
110
- # A `String` will be treated as the path to the keyfile to be used for the construction of
111
- # credentials for this client.
112
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
113
- # credentials for this client.
114
- # A `GRPC::Core::Channel` will be used to make calls through.
115
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
116
- # should already be composed with a `GRPC::Core::CallCredentials` object.
117
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
118
- # metadata for requests, generally, to give OAuth credentials.
119
- # @param scopes [Array<String>]
120
- # The OAuth scopes for this service. This parameter is ignored if
121
- # an updater_proc is supplied.
122
- # @param client_config [Hash]
123
- # A Hash for call options for each method. See
124
- # Google::Gax#construct_settings for the structure of
125
- # this data. Falls back to the default config if not specified
126
- # or the specified config is missing data points.
127
- # @param timeout [Numeric]
128
- # The default timeout, in seconds, for calls made through this client.
129
- # @param metadata [Hash]
130
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
131
- # @param service_address [String]
132
- # Override for the service hostname, or `nil` to leave as the default.
133
- # @param service_port [Integer]
134
- # Override for the service port, or `nil` to leave as the default.
135
- # @param exception_transformer [Proc]
136
- # An optional proc that intercepts any exceptions raised during an API call to inject
137
- # custom error handling.
138
- def self.new \
139
- credentials: nil,
140
- scopes: nil,
141
- client_config: nil,
142
- timeout: nil,
143
- metadata: nil,
144
- service_address: nil,
145
- service_port: nil,
146
- exception_transformer: nil,
147
- lib_name: nil,
148
- lib_version: nil
149
- kwargs = {
150
- credentials: credentials,
151
- scopes: scopes,
152
- client_config: client_config,
153
- timeout: timeout,
154
- metadata: metadata,
155
- exception_transformer: exception_transformer,
156
- lib_name: lib_name,
157
- service_address: service_address,
158
- service_port: service_port,
159
- lib_version: lib_version
160
- }.select { |_, v| v != nil }
161
- Google::Cloud::Speech::V1p1beta1::SpeechClient.new(**kwargs)
162
- end
163
- end
164
- end
165
- end
166
- end
@@ -1,200 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/speech/v1p1beta1/cloud_speech.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- require 'google/api/client_pb'
9
- require 'google/api/field_behavior_pb'
10
- require 'google/longrunning/operations_pb'
11
- require 'google/protobuf/any_pb'
12
- require 'google/protobuf/duration_pb'
13
- require 'google/protobuf/timestamp_pb'
14
- require 'google/rpc/status_pb'
15
- Google::Protobuf::DescriptorPool.generated_pool.build do
16
- add_message "google.cloud.speech.v1p1beta1.RecognizeRequest" do
17
- optional :config, :message, 1, "google.cloud.speech.v1p1beta1.RecognitionConfig"
18
- optional :audio, :message, 2, "google.cloud.speech.v1p1beta1.RecognitionAudio"
19
- end
20
- add_message "google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest" do
21
- optional :config, :message, 1, "google.cloud.speech.v1p1beta1.RecognitionConfig"
22
- optional :audio, :message, 2, "google.cloud.speech.v1p1beta1.RecognitionAudio"
23
- end
24
- add_message "google.cloud.speech.v1p1beta1.StreamingRecognizeRequest" do
25
- oneof :streaming_request do
26
- optional :streaming_config, :message, 1, "google.cloud.speech.v1p1beta1.StreamingRecognitionConfig"
27
- optional :audio_content, :bytes, 2
28
- end
29
- end
30
- add_message "google.cloud.speech.v1p1beta1.StreamingRecognitionConfig" do
31
- optional :config, :message, 1, "google.cloud.speech.v1p1beta1.RecognitionConfig"
32
- optional :single_utterance, :bool, 2
33
- optional :interim_results, :bool, 3
34
- end
35
- add_message "google.cloud.speech.v1p1beta1.RecognitionConfig" do
36
- optional :encoding, :enum, 1, "google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding"
37
- optional :sample_rate_hertz, :int32, 2
38
- optional :audio_channel_count, :int32, 7
39
- optional :enable_separate_recognition_per_channel, :bool, 12
40
- optional :language_code, :string, 3
41
- repeated :alternative_language_codes, :string, 18
42
- optional :max_alternatives, :int32, 4
43
- optional :profanity_filter, :bool, 5
44
- repeated :speech_contexts, :message, 6, "google.cloud.speech.v1p1beta1.SpeechContext"
45
- optional :enable_word_time_offsets, :bool, 8
46
- optional :enable_word_confidence, :bool, 15
47
- optional :enable_automatic_punctuation, :bool, 11
48
- optional :enable_speaker_diarization, :bool, 16
49
- optional :diarization_speaker_count, :int32, 17
50
- optional :diarization_config, :message, 19, "google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig"
51
- optional :metadata, :message, 9, "google.cloud.speech.v1p1beta1.RecognitionMetadata"
52
- optional :model, :string, 13
53
- optional :use_enhanced, :bool, 14
54
- end
55
- add_enum "google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding" do
56
- value :ENCODING_UNSPECIFIED, 0
57
- value :LINEAR16, 1
58
- value :FLAC, 2
59
- value :MULAW, 3
60
- value :AMR, 4
61
- value :AMR_WB, 5
62
- value :OGG_OPUS, 6
63
- value :SPEEX_WITH_HEADER_BYTE, 7
64
- value :MP3, 8
65
- end
66
- add_message "google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig" do
67
- optional :enable_speaker_diarization, :bool, 1
68
- optional :min_speaker_count, :int32, 2
69
- optional :max_speaker_count, :int32, 3
70
- end
71
- add_message "google.cloud.speech.v1p1beta1.RecognitionMetadata" do
72
- optional :interaction_type, :enum, 1, "google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType"
73
- optional :industry_naics_code_of_audio, :uint32, 3
74
- optional :microphone_distance, :enum, 4, "google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance"
75
- optional :original_media_type, :enum, 5, "google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType"
76
- optional :recording_device_type, :enum, 6, "google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType"
77
- optional :recording_device_name, :string, 7
78
- optional :original_mime_type, :string, 8
79
- optional :obfuscated_id, :int64, 9
80
- optional :audio_topic, :string, 10
81
- end
82
- add_enum "google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType" do
83
- value :INTERACTION_TYPE_UNSPECIFIED, 0
84
- value :DISCUSSION, 1
85
- value :PRESENTATION, 2
86
- value :PHONE_CALL, 3
87
- value :VOICEMAIL, 4
88
- value :PROFESSIONALLY_PRODUCED, 5
89
- value :VOICE_SEARCH, 6
90
- value :VOICE_COMMAND, 7
91
- value :DICTATION, 8
92
- end
93
- add_enum "google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance" do
94
- value :MICROPHONE_DISTANCE_UNSPECIFIED, 0
95
- value :NEARFIELD, 1
96
- value :MIDFIELD, 2
97
- value :FARFIELD, 3
98
- end
99
- add_enum "google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType" do
100
- value :ORIGINAL_MEDIA_TYPE_UNSPECIFIED, 0
101
- value :AUDIO, 1
102
- value :VIDEO, 2
103
- end
104
- add_enum "google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType" do
105
- value :RECORDING_DEVICE_TYPE_UNSPECIFIED, 0
106
- value :SMARTPHONE, 1
107
- value :PC, 2
108
- value :PHONE_LINE, 3
109
- value :VEHICLE, 4
110
- value :OTHER_OUTDOOR_DEVICE, 5
111
- value :OTHER_INDOOR_DEVICE, 6
112
- end
113
- add_message "google.cloud.speech.v1p1beta1.SpeechContext" do
114
- repeated :phrases, :string, 1
115
- optional :boost, :float, 4
116
- end
117
- add_message "google.cloud.speech.v1p1beta1.RecognitionAudio" do
118
- oneof :audio_source do
119
- optional :content, :bytes, 1
120
- optional :uri, :string, 2
121
- end
122
- end
123
- add_message "google.cloud.speech.v1p1beta1.RecognizeResponse" do
124
- repeated :results, :message, 2, "google.cloud.speech.v1p1beta1.SpeechRecognitionResult"
125
- end
126
- add_message "google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse" do
127
- repeated :results, :message, 2, "google.cloud.speech.v1p1beta1.SpeechRecognitionResult"
128
- end
129
- add_message "google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata" do
130
- optional :progress_percent, :int32, 1
131
- optional :start_time, :message, 2, "google.protobuf.Timestamp"
132
- optional :last_update_time, :message, 3, "google.protobuf.Timestamp"
133
- end
134
- add_message "google.cloud.speech.v1p1beta1.StreamingRecognizeResponse" do
135
- optional :error, :message, 1, "google.rpc.Status"
136
- repeated :results, :message, 2, "google.cloud.speech.v1p1beta1.StreamingRecognitionResult"
137
- optional :speech_event_type, :enum, 4, "google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType"
138
- end
139
- add_enum "google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType" do
140
- value :SPEECH_EVENT_UNSPECIFIED, 0
141
- value :END_OF_SINGLE_UTTERANCE, 1
142
- end
143
- add_message "google.cloud.speech.v1p1beta1.StreamingRecognitionResult" do
144
- repeated :alternatives, :message, 1, "google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative"
145
- optional :is_final, :bool, 2
146
- optional :stability, :float, 3
147
- optional :result_end_time, :message, 4, "google.protobuf.Duration"
148
- optional :channel_tag, :int32, 5
149
- optional :language_code, :string, 6
150
- end
151
- add_message "google.cloud.speech.v1p1beta1.SpeechRecognitionResult" do
152
- repeated :alternatives, :message, 1, "google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative"
153
- optional :channel_tag, :int32, 2
154
- optional :language_code, :string, 5
155
- end
156
- add_message "google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative" do
157
- optional :transcript, :string, 1
158
- optional :confidence, :float, 2
159
- repeated :words, :message, 3, "google.cloud.speech.v1p1beta1.WordInfo"
160
- end
161
- add_message "google.cloud.speech.v1p1beta1.WordInfo" do
162
- optional :start_time, :message, 1, "google.protobuf.Duration"
163
- optional :end_time, :message, 2, "google.protobuf.Duration"
164
- optional :word, :string, 3
165
- optional :confidence, :float, 4
166
- optional :speaker_tag, :int32, 5
167
- end
168
- end
169
-
170
- module Google
171
- module Cloud
172
- module Speech
173
- module V1p1beta1
174
- RecognizeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognizeRequest").msgclass
175
- LongRunningRecognizeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest").msgclass
176
- StreamingRecognizeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeRequest").msgclass
177
- StreamingRecognitionConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognitionConfig").msgclass
178
- RecognitionConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionConfig").msgclass
179
- RecognitionConfig::AudioEncoding = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding").enummodule
180
- SpeakerDiarizationConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig").msgclass
181
- RecognitionMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata").msgclass
182
- RecognitionMetadata::InteractionType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType").enummodule
183
- RecognitionMetadata::MicrophoneDistance = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance").enummodule
184
- RecognitionMetadata::OriginalMediaType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType").enummodule
185
- RecognitionMetadata::RecordingDeviceType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType").enummodule
186
- SpeechContext = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechContext").msgclass
187
- RecognitionAudio = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionAudio").msgclass
188
- RecognizeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognizeResponse").msgclass
189
- LongRunningRecognizeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse").msgclass
190
- LongRunningRecognizeMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata").msgclass
191
- StreamingRecognizeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeResponse").msgclass
192
- StreamingRecognizeResponse::SpeechEventType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType").enummodule
193
- StreamingRecognitionResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognitionResult").msgclass
194
- SpeechRecognitionResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechRecognitionResult").msgclass
195
- SpeechRecognitionAlternative = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative").msgclass
196
- WordInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.WordInfo").msgclass
197
- end
198
- end
199
- end
200
- end
@@ -1,58 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/cloud/speech/v1p1beta1/cloud_speech.proto for package 'google.cloud.speech.v1p1beta1'
3
- # Original file comments:
4
- # Copyright 2019 Google LLC.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
- #
19
-
20
-
21
- require 'grpc'
22
- require 'google/cloud/speech/v1p1beta1/cloud_speech_pb'
23
-
24
- module Google
25
- module Cloud
26
- module Speech
27
- module V1p1beta1
28
- module Speech
29
- # Service that implements Google Cloud Speech API.
30
- class Service
31
-
32
- include GRPC::GenericService
33
-
34
- self.marshal_class_method = :encode
35
- self.unmarshal_class_method = :decode
36
- self.service_name = 'google.cloud.speech.v1p1beta1.Speech'
37
-
38
- # Performs synchronous speech recognition: receive results after all audio
39
- # has been sent and processed.
40
- rpc :Recognize, RecognizeRequest, RecognizeResponse
41
- # Performs asynchronous speech recognition: receive results via the
42
- # google.longrunning.Operations interface. Returns either an
43
- # `Operation.error` or an `Operation.response` which contains
44
- # a `LongRunningRecognizeResponse` message.
45
- # For more information on asynchronous speech recognition, see the
46
- # [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
47
- rpc :LongRunningRecognize, LongRunningRecognizeRequest, Google::Longrunning::Operation
48
- # Performs bidirectional streaming speech recognition: receive results while
49
- # sending audio. This method is only available via the gRPC API (not REST).
50
- rpc :StreamingRecognize, stream(StreamingRecognizeRequest), stream(StreamingRecognizeResponse)
51
- end
52
-
53
- Stub = Service.rpc_stub_class
54
- end
55
- end
56
- end
57
- end
58
- end
@@ -1,41 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "googleauth"
17
-
18
- module Google
19
- module Cloud
20
- module Speech
21
- module V1p1beta1
22
- class Credentials < Google::Auth::Credentials
23
- SCOPE = [
24
- "https://www.googleapis.com/auth/cloud-platform"
25
- ].freeze
26
- PATH_ENV_VARS = %w(SPEECH_CREDENTIALS
27
- SPEECH_KEYFILE
28
- GOOGLE_CLOUD_CREDENTIALS
29
- GOOGLE_CLOUD_KEYFILE
30
- GCLOUD_KEYFILE)
31
- JSON_ENV_VARS = %w(SPEECH_CREDENTIALS_JSON
32
- SPEECH_KEYFILE_JSON
33
- GOOGLE_CLOUD_CREDENTIALS_JSON
34
- GOOGLE_CLOUD_KEYFILE_JSON
35
- GCLOUD_KEYFILE_JSON)
36
- DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
37
- end
38
- end
39
- end
40
- end
41
- end