google-cloud-text_to_speech-v1 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 132cc7121d909330b244eca9c63675e7b806965b875992d91e0e2ceef024b4d9
4
- data.tar.gz: 80214e9c9f61924a010f7af91ae0c3a006fb462f1ebc14aa3b08693794c96511
3
+ metadata.gz: e01f3eb8d02c43950e328a35d41a27a2c720cac2065514148c555656fe8273b6
4
+ data.tar.gz: 7580a916720c64a4c0c516fd8af4d22dd5ec364765eb0c3488235e6acbb348fe
5
5
  SHA512:
6
- metadata.gz: ba74b45b67c0df18ad8cac42e0c906e26895a76215115799c0c1ab11aca4276776d0d2ad039ded71f41c9f829fcf1dc2d0e997d188d4544307c25e1f48088a5d
7
- data.tar.gz: ba0db213f75befc14423a5f9631310d2078de604de0cf2478d6594776d2930346c3f69150f2a22825dea6ebb08f659ddef7dda9a0d66d2b7646f72e43c5ffa82
6
+ metadata.gz: 8086e26ada49d2a16fb3dc903be21c05ca8fb6c2d4d0569c46e62b981d86f3c06fae70976527c095eccd0ed82c922e8991d6b43011fce2c6bb210cd5606d79df
7
+ data.tar.gz: f0fcc86a5fb60fc128b23ffc1f2bca89251eb0766d11856911a95ee183299f57e1965cfca8adc517f403ac0608983c4e3058ad233d19b782171787245e00a841
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-text_to_speech-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::TextToSpeech::V1::TextToSpeech::Credentials}):
68
68
 
69
- 1. `TEXTTOSPEECH_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `TEXTTOSPEECH_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `TEXTTOSPEECH_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `TEXTTOSPEECH_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/text_to_speech/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/text_to_speech/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config|
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/text_to_speech/v1"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/text_to_speech/v1"
34
34
 
35
35
  client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new # (request fields as keyword arguments...)
37
37
  response = client.list_voices request
38
38
  ```
39
39
 
@@ -39,13 +39,12 @@ module Google
39
39
  # See {::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client::Configuration}
40
40
  # for a description of the configuration fields.
41
41
  #
42
- # ## Example
42
+ # @example
43
43
  #
44
- # To modify the configuration for all TextToSpeech clients:
45
- #
46
- # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.configure do |config|
47
- # config.timeout = 10.0
48
- # end
44
+ # # Modify the configuration for all TextToSpeech clients
45
+ # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.configure do |config|
46
+ # config.timeout = 10.0
47
+ # end
49
48
  #
50
49
  # @yield [config] Configure the Client client.
51
50
  # @yieldparam config [Client::Configuration]
@@ -63,20 +62,9 @@ module Google
63
62
  end
64
63
  default_config = Client::Configuration.new parent_config
65
64
 
66
- default_config.rpcs.list_voices.timeout = 600.0
67
- default_config.rpcs.list_voices.retry_policy = {
68
- initial_delay: 0.1,
69
- max_delay: 60.0,
70
- multiplier: 1.3,
71
- retry_codes: [14, 4]
72
- }
73
-
74
- default_config.rpcs.synthesize_speech.timeout = 600.0
75
- default_config.rpcs.synthesize_speech.retry_policy = {
76
- initial_delay: 0.1,
77
- max_delay: 60.0,
78
- multiplier: 1.3,
79
- retry_codes: [14, 4]
65
+ default_config.timeout = 300.0
66
+ default_config.retry_policy = {
67
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
80
68
  }
81
69
 
82
70
  default_config
@@ -108,19 +96,15 @@ module Google
108
96
  ##
109
97
  # Create a new TextToSpeech client object.
110
98
  #
111
- # ## Examples
99
+ # @example
112
100
  #
113
- # To create a new TextToSpeech client with the default
114
- # configuration:
101
+ # # Create a client using the default configuration
102
+ # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new
115
103
  #
116
- # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new
117
- #
118
- # To create a new TextToSpeech client with a custom
119
- # configuration:
120
- #
121
- # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config|
122
- # config.timeout = 10.0
123
- # end
104
+ # # Create a client using a custom configuration
105
+ # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config|
106
+ # config.timeout = 10.0
107
+ # end
124
108
  #
125
109
  # @yield [config] Configure the TextToSpeech client.
126
110
  # @yieldparam config [Client::Configuration]
@@ -140,14 +124,13 @@ module Google
140
124
 
141
125
  # Create credentials
142
126
  credentials = @config.credentials
143
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
127
+ # Use self-signed JWT if the endpoint is unchanged from default,
144
128
  # but only if the default endpoint does not have a region prefix.
145
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
146
- @config.endpoint == Client.configure.endpoint &&
129
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
147
130
  !@config.endpoint.split(".").first.include?("-")
148
131
  credentials ||= Credentials.default scope: @config.scope,
149
132
  enable_self_signed_jwt: enable_self_signed_jwt
150
- if credentials.is_a?(String) || credentials.is_a?(Hash)
133
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
151
134
  credentials = Credentials.new credentials, scope: @config.scope
152
135
  end
153
136
  @quota_project_id = @config.quota_project
@@ -186,11 +169,11 @@ module Google
186
169
  # Optional. Recommended.
187
170
  # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If
188
171
  # specified, the ListVoices call will only return voices that can be used to
189
- # synthesize this language_code. E.g. when specifying "en-NZ", you will get
190
- # supported "en-\*" voices; when specifying "no", you will get supported
191
- # "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh"
192
- # will also get supported "cmn-\*" voices; specifying "zh-hk" will also get
193
- # supported "yue-\*" voices.
172
+ # synthesize this language_code. E.g. when specifying `"en-NZ"`, you will get
173
+ # supported `"en-\*"` voices; when specifying `"no"`, you will get supported
174
+ # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices; specifying
175
+ # `"zh"` will also get supported `"cmn-\*"` voices; specifying `"zh-hk"` will
176
+ # also get supported `"yue-\*"` voices.
194
177
  #
195
178
  # @yield [response, operation] Access the result along with the RPC operation
196
179
  # @yieldparam response [::Google::Cloud::TextToSpeech::V1::ListVoicesResponse]
@@ -200,6 +183,21 @@ module Google
200
183
  #
201
184
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
202
185
  #
186
+ # @example Basic example
187
+ # require "google/cloud/text_to_speech/v1"
188
+ #
189
+ # # Create a client object. The client can be reused for multiple calls.
190
+ # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new
191
+ #
192
+ # # Create a request. To set request fields, pass in keyword arguments.
193
+ # request = Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new
194
+ #
195
+ # # Call the list_voices method.
196
+ # result = client.list_voices request
197
+ #
198
+ # # The returned object is of type Google::Cloud::TextToSpeech::V1::ListVoicesResponse.
199
+ # p result
200
+ #
203
201
  def list_voices request, options = nil
204
202
  raise ::ArgumentError, "request must be provided" if request.nil?
205
203
 
@@ -220,7 +218,9 @@ module Google
220
218
  options.apply_defaults timeout: @config.rpcs.list_voices.timeout,
221
219
  metadata: metadata,
222
220
  retry_policy: @config.rpcs.list_voices.retry_policy
223
- options.apply_defaults metadata: @config.metadata,
221
+
222
+ options.apply_defaults timeout: @config.timeout,
223
+ metadata: @config.metadata,
224
224
  retry_policy: @config.retry_policy
225
225
 
226
226
  @text_to_speech_stub.call_rpc :list_voices, request, options: options do |response, operation|
@@ -265,6 +265,21 @@ module Google
265
265
  #
266
266
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
267
267
  #
268
+ # @example Basic example
269
+ # require "google/cloud/text_to_speech/v1"
270
+ #
271
+ # # Create a client object. The client can be reused for multiple calls.
272
+ # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new
273
+ #
274
+ # # Create a request. To set request fields, pass in keyword arguments.
275
+ # request = Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new
276
+ #
277
+ # # Call the synthesize_speech method.
278
+ # result = client.synthesize_speech request
279
+ #
280
+ # # The returned object is of type Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse.
281
+ # p result
282
+ #
268
283
  def synthesize_speech request, options = nil
269
284
  raise ::ArgumentError, "request must be provided" if request.nil?
270
285
 
@@ -285,7 +300,9 @@ module Google
285
300
  options.apply_defaults timeout: @config.rpcs.synthesize_speech.timeout,
286
301
  metadata: metadata,
287
302
  retry_policy: @config.rpcs.synthesize_speech.retry_policy
288
- options.apply_defaults metadata: @config.metadata,
303
+
304
+ options.apply_defaults timeout: @config.timeout,
305
+ metadata: @config.metadata,
289
306
  retry_policy: @config.retry_policy
290
307
 
291
308
  @text_to_speech_stub.call_rpc :synthesize_speech, request, options: options do |response, operation|
@@ -309,22 +326,21 @@ module Google
309
326
  # Configuration can be applied globally to all clients, or to a single client
310
327
  # on construction.
311
328
  #
312
- # # Examples
313
- #
314
- # To modify the global config, setting the timeout for list_voices
315
- # to 20 seconds, and all remaining timeouts to 10 seconds:
316
- #
317
- # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.configure do |config|
318
- # config.timeout = 10.0
319
- # config.rpcs.list_voices.timeout = 20.0
320
- # end
321
- #
322
- # To apply the above configuration only to a new client:
323
- #
324
- # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config|
325
- # config.timeout = 10.0
326
- # config.rpcs.list_voices.timeout = 20.0
327
- # end
329
+ # @example
330
+ #
331
+ # # Modify the global config, setting the timeout for
332
+ # # list_voices to 20 seconds,
333
+ # # and all remaining timeouts to 10 seconds.
334
+ # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.configure do |config|
335
+ # config.timeout = 10.0
336
+ # config.rpcs.list_voices.timeout = 20.0
337
+ # end
338
+ #
339
+ # # Apply the above configuration only to a new client.
340
+ # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config|
341
+ # config.timeout = 10.0
342
+ # config.rpcs.list_voices.timeout = 20.0
343
+ # end
328
344
  #
329
345
  # @!attribute [rw] endpoint
330
346
  # The hostname or hostname:port of the service endpoint.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module TextToSpeech
23
23
  module V1
24
- VERSION = "0.4.1"
24
+ VERSION = "0.5.0"
25
25
  end
26
26
  end
27
27
  end
@@ -1,11 +1,12 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/texttospeech/v1/cloud_tts.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
7
+ require 'google/api/resource_pb'
8
+ require 'google/protobuf'
9
+
9
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
11
  add_file("google/cloud/texttospeech/v1/cloud_tts.proto", :syntax => :proto3) do
11
12
  add_message "google.cloud.texttospeech.v1.ListVoicesRequest" do
@@ -58,6 +59,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
58
59
  value :LINEAR16, 1
59
60
  value :MP3, 2
60
61
  value :OGG_OPUS, 3
62
+ value :MULAW, 5
63
+ value :ALAW, 6
61
64
  end
62
65
  end
63
66
  end
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/cloud/texttospeech/v1/cloud_tts.proto for package 'Google.Cloud.TextToSpeech.V1'
3
3
  # Original file comments:
4
- # Copyright 2019 Google LLC.
4
+ # Copyright 2021 Google LLC
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- #
19
18
 
20
19
  require 'grpc'
21
20
  require 'google/cloud/texttospeech/v1/cloud_tts_pb'
@@ -57,9 +57,15 @@ module Google
57
57
 
58
58
  # Denotes that a (repeated) field is an unordered list.
59
59
  # This indicates that the service may provide the elements of the list
60
- # in any arbitrary order, rather than the order the user originally
60
+ # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
@@ -27,11 +27,11 @@ module Google
27
27
  # Optional. Recommended.
28
28
  # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If
29
29
  # specified, the ListVoices call will only return voices that can be used to
30
- # synthesize this language_code. E.g. when specifying "en-NZ", you will get
31
- # supported "en-\*" voices; when specifying "no", you will get supported
32
- # "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh"
33
- # will also get supported "cmn-\*" voices; specifying "zh-hk" will also get
34
- # supported "yue-\*" voices.
30
+ # synthesize this language_code. E.g. when specifying `"en-NZ"`, you will get
31
+ # supported `"en-\*"` voices; when specifying `"no"`, you will get supported
32
+ # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices; specifying
33
+ # `"zh"` will also get supported `"cmn-\*"` voices; specifying `"zh-hk"` will
34
+ # also get supported `"yue-\*"` voices.
35
35
  class ListVoicesRequest
36
36
  include ::Google::Protobuf::MessageExts
37
37
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -205,7 +205,7 @@ module Google
205
205
  # A female voice.
206
206
  FEMALE = 2
207
207
 
208
- # A gender-neutral voice.
208
+ # A gender-neutral voice. This voice is not yet supported.
209
209
  NEUTRAL = 3
210
210
  end
211
211
 
@@ -227,6 +227,14 @@ module Google
227
227
  # Chrome and Firefox). The quality of the encoding is considerably higher
228
228
  # than MP3 while using approximately the same bitrate.
229
229
  OGG_OPUS = 3
230
+
231
+ # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
232
+ # Audio content returned as MULAW also contains a WAV header.
233
+ MULAW = 5
234
+
235
+ # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law.
236
+ # Audio content returned as ALAW also contains a WAV header.
237
+ ALAW = 6
230
238
  end
231
239
  end
232
240
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-text_to_speech-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-17 00:00:00.000000000 Z
11
+ date: 2021-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.5'
19
+ version: '0.7'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.5'
29
+ version: '0.7'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a