google-cloud-text_to_speech-v1beta1 0.2.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb +12 -18
- data/lib/google/cloud/text_to_speech/v1beta1/version.rb +1 -1
- data/lib/google/cloud/texttospeech/v1beta1/cloud_tts_pb.rb +15 -0
- data/lib/google/cloud/texttospeech/v1beta1/cloud_tts_services_pb.rb +0 -1
- data/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb +45 -6
- metadata +5 -6
- data/lib/google/cloud/common_resources_pb.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57da9d3751dae0ce3d93e834a59cb587261611f80f5efe92fa892e50249f0f83
|
4
|
+
data.tar.gz: 36cccdf3baf7006be27595e542d05624600944d601bf7ba77b766cf4f17e0142
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 930480ef5dc944dfa0d237fca619d9637d126cbb64055a635aa6a71e306c2ce69d8d5fa60c489c3af178cb9158259d280d790bbe32df4b8c00a64da11b1ea4db
|
7
|
+
data.tar.gz: f3db897f2e31a4b4c0ff3ab2551a32c680886fc6c500b9e2085ced93d907f7d5f02179f105fd53a68737fa3ef8d4dfe457c6333fe46e9d23106c15068069d7d8
|
data/README.md
CHANGED
@@ -18,6 +18,7 @@ In order to use this library, you first need to go through the following steps:
|
|
18
18
|
|
19
19
|
1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
20
20
|
1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
21
|
+
1. [Enable the API.](https://console.cloud.google.com/apis/library/texttospeech.googleapis.com)
|
21
22
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
22
23
|
|
23
24
|
## Quick Start
|
@@ -33,6 +34,9 @@ response = client.list_voices request
|
|
33
34
|
View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-text_to_speech-v1beta1/latest)
|
34
35
|
for class and method documentation.
|
35
36
|
|
37
|
+
See also the [Product Documentation](https://cloud.google.com/text-to-speech)
|
38
|
+
for general usage information.
|
39
|
+
|
36
40
|
## Enabling Logging
|
37
41
|
|
38
42
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
@@ -63,20 +63,12 @@ module Google
|
|
63
63
|
end
|
64
64
|
default_config = Client::Configuration.new parent_config
|
65
65
|
|
66
|
-
default_config.
|
67
|
-
default_config.
|
66
|
+
default_config.timeout = 300.0
|
67
|
+
default_config.retry_policy = {
|
68
68
|
initial_delay: 0.1,
|
69
69
|
max_delay: 60.0,
|
70
70
|
multiplier: 1.3,
|
71
|
-
retry_codes: [
|
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: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
71
|
+
retry_codes: [14, 4]
|
80
72
|
}
|
81
73
|
|
82
74
|
default_config
|
@@ -181,10 +173,10 @@ module Google
|
|
181
173
|
# [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If
|
182
174
|
# specified, the ListVoices call will only return voices that can be used to
|
183
175
|
# synthesize this language_code. E.g. when specifying "en-NZ", you will get
|
184
|
-
# supported "en
|
185
|
-
# "no
|
186
|
-
# will also get supported "cmn
|
187
|
-
# supported "yue
|
176
|
+
# supported "en-\*" voices; when specifying "no", you will get supported
|
177
|
+
# "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh"
|
178
|
+
# will also get supported "cmn-\*" voices; specifying "zh-hk" will also get
|
179
|
+
# supported "yue-\*" voices.
|
188
180
|
#
|
189
181
|
# @yield [response, operation] Access the result along with the RPC operation
|
190
182
|
# @yieldparam response [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse]
|
@@ -239,7 +231,7 @@ module Google
|
|
239
231
|
# @param options [::Gapic::CallOptions, ::Hash]
|
240
232
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
241
233
|
#
|
242
|
-
# @overload synthesize_speech(input: nil, voice: nil, audio_config: nil)
|
234
|
+
# @overload synthesize_speech(input: nil, voice: nil, audio_config: nil, enable_time_pointing: nil)
|
243
235
|
# Pass arguments to `synthesize_speech` via keyword arguments. Note that at
|
244
236
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
245
237
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -250,6 +242,8 @@ module Google
|
|
250
242
|
# Required. The desired voice of the synthesized audio.
|
251
243
|
# @param audio_config [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig, ::Hash]
|
252
244
|
# Required. The configuration of the synthesized audio.
|
245
|
+
# @param enable_time_pointing [::Array<::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest::TimepointType>]
|
246
|
+
# Whether and what timepoints should be returned in the response.
|
253
247
|
#
|
254
248
|
# @yield [response, operation] Access the result along with the RPC operation
|
255
249
|
# @yieldparam response [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse]
|
@@ -375,7 +369,7 @@ module Google
|
|
375
369
|
|
376
370
|
config_attr :endpoint, "texttospeech.googleapis.com", ::String
|
377
371
|
config_attr :credentials, nil do |value|
|
378
|
-
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
372
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
379
373
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
380
374
|
allowed.any? { |klass| klass === value }
|
381
375
|
end
|
@@ -403,7 +397,7 @@ module Google
|
|
403
397
|
def rpcs
|
404
398
|
@rpcs ||= begin
|
405
399
|
parent_rpcs = nil
|
406
|
-
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to?
|
400
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
407
401
|
Rpcs.new parent_rpcs
|
408
402
|
end
|
409
403
|
end
|
@@ -24,6 +24,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
24
24
|
optional :input, :message, 1, "google.cloud.texttospeech.v1beta1.SynthesisInput"
|
25
25
|
optional :voice, :message, 2, "google.cloud.texttospeech.v1beta1.VoiceSelectionParams"
|
26
26
|
optional :audio_config, :message, 3, "google.cloud.texttospeech.v1beta1.AudioConfig"
|
27
|
+
repeated :enable_time_pointing, :enum, 4, "google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest.TimepointType"
|
28
|
+
end
|
29
|
+
add_enum "google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest.TimepointType" do
|
30
|
+
value :TIMEPOINT_TYPE_UNSPECIFIED, 0
|
31
|
+
value :SSML_MARK, 1
|
27
32
|
end
|
28
33
|
add_message "google.cloud.texttospeech.v1beta1.SynthesisInput" do
|
29
34
|
oneof :input_source do
|
@@ -46,6 +51,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
46
51
|
end
|
47
52
|
add_message "google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse" do
|
48
53
|
optional :audio_content, :bytes, 1
|
54
|
+
repeated :timepoints, :message, 2, "google.cloud.texttospeech.v1beta1.Timepoint"
|
55
|
+
optional :audio_config, :message, 4, "google.cloud.texttospeech.v1beta1.AudioConfig"
|
56
|
+
end
|
57
|
+
add_message "google.cloud.texttospeech.v1beta1.Timepoint" do
|
58
|
+
optional :mark_name, :string, 4
|
59
|
+
optional :time_seconds, :double, 3
|
49
60
|
end
|
50
61
|
add_enum "google.cloud.texttospeech.v1beta1.SsmlVoiceGender" do
|
51
62
|
value :SSML_VOICE_GENDER_UNSPECIFIED, 0
|
@@ -57,7 +68,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
57
68
|
value :AUDIO_ENCODING_UNSPECIFIED, 0
|
58
69
|
value :LINEAR16, 1
|
59
70
|
value :MP3, 2
|
71
|
+
value :MP3_64_KBPS, 4
|
60
72
|
value :OGG_OPUS, 3
|
73
|
+
value :MULAW, 5
|
61
74
|
end
|
62
75
|
end
|
63
76
|
end
|
@@ -70,10 +83,12 @@ module Google
|
|
70
83
|
ListVoicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.ListVoicesResponse").msgclass
|
71
84
|
Voice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.Voice").msgclass
|
72
85
|
SynthesizeSpeechRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest").msgclass
|
86
|
+
SynthesizeSpeechRequest::TimepointType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest.TimepointType").enummodule
|
73
87
|
SynthesisInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesisInput").msgclass
|
74
88
|
VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.VoiceSelectionParams").msgclass
|
75
89
|
AudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.AudioConfig").msgclass
|
76
90
|
SynthesizeSpeechResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse").msgclass
|
91
|
+
Timepoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.Timepoint").msgclass
|
77
92
|
SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SsmlVoiceGender").enummodule
|
78
93
|
AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.AudioEncoding").enummodule
|
79
94
|
end
|
@@ -28,10 +28,10 @@ module Google
|
|
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
30
|
# synthesize this language_code. E.g. when specifying "en-NZ", you will get
|
31
|
-
# supported "en
|
32
|
-
# "no
|
33
|
-
# will also get supported "cmn
|
34
|
-
# supported "yue
|
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.
|
35
35
|
class ListVoicesRequest
|
36
36
|
include ::Google::Protobuf::MessageExts
|
37
37
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -76,9 +76,21 @@ module Google
|
|
76
76
|
# @!attribute [rw] audio_config
|
77
77
|
# @return [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig]
|
78
78
|
# Required. The configuration of the synthesized audio.
|
79
|
+
# @!attribute [rw] enable_time_pointing
|
80
|
+
# @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest::TimepointType>]
|
81
|
+
# Whether and what timepoints should be returned in the response.
|
79
82
|
class SynthesizeSpeechRequest
|
80
83
|
include ::Google::Protobuf::MessageExts
|
81
84
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
85
|
+
|
86
|
+
# The type of timepoint information that is returned in the response.
|
87
|
+
module TimepointType
|
88
|
+
# Not specified. No timepoint information will be returned.
|
89
|
+
TIMEPOINT_TYPE_UNSPECIFIED = 0
|
90
|
+
|
91
|
+
# Timepoint information of `<mark>` tags in SSML input will be returned.
|
92
|
+
SSML_MARK = 1
|
93
|
+
end
|
82
94
|
end
|
83
95
|
|
84
96
|
# Contains text input to be synthesized. Either `text` or `ssml` must be
|
@@ -93,7 +105,7 @@ module Google
|
|
93
105
|
# The SSML document to be synthesized. The SSML document must be valid
|
94
106
|
# and well-formed. Otherwise the RPC will fail and return
|
95
107
|
# [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
|
96
|
-
# [SSML](/
|
108
|
+
# [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
|
97
109
|
class SynthesisInput
|
98
110
|
include ::Google::Protobuf::MessageExts
|
99
111
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -184,11 +196,31 @@ module Google
|
|
184
196
|
# For LINEAR16 audio, we include the WAV header. Note: as
|
185
197
|
# with all bytes fields, protobuffers use a pure binary representation,
|
186
198
|
# whereas JSON representations use base64.
|
199
|
+
# @!attribute [rw] timepoints
|
200
|
+
# @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::Timepoint>]
|
201
|
+
# A link between a position in the original request input and a corresponding
|
202
|
+
# time in the output audio. It's only supported via `<mark>` of SSML input.
|
203
|
+
# @!attribute [rw] audio_config
|
204
|
+
# @return [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig]
|
205
|
+
# The audio metadata of `audio_content`.
|
187
206
|
class SynthesizeSpeechResponse
|
188
207
|
include ::Google::Protobuf::MessageExts
|
189
208
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
190
209
|
end
|
191
210
|
|
211
|
+
# This contains a mapping between a certain point in the input text and a
|
212
|
+
# corresponding time in the output audio.
|
213
|
+
# @!attribute [rw] mark_name
|
214
|
+
# @return [::String]
|
215
|
+
# Timepoint name as received from the client within `<mark>` tag.
|
216
|
+
# @!attribute [rw] time_seconds
|
217
|
+
# @return [::Float]
|
218
|
+
# Time offset in seconds from the start of the synthesized audio.
|
219
|
+
class Timepoint
|
220
|
+
include ::Google::Protobuf::MessageExts
|
221
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
222
|
+
end
|
223
|
+
|
192
224
|
# Gender of the voice as described in
|
193
225
|
# [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice).
|
194
226
|
module SsmlVoiceGender
|
@@ -205,7 +237,7 @@ module Google
|
|
205
237
|
# A female voice.
|
206
238
|
FEMALE = 2
|
207
239
|
|
208
|
-
# A gender-neutral voice.
|
240
|
+
# A gender-neutral voice. This voice is not yet supported.
|
209
241
|
NEUTRAL = 3
|
210
242
|
end
|
211
243
|
|
@@ -222,11 +254,18 @@ module Google
|
|
222
254
|
# MP3 audio at 32kbps.
|
223
255
|
MP3 = 2
|
224
256
|
|
257
|
+
# MP3 at 64kbps.
|
258
|
+
MP3_64_KBPS = 4
|
259
|
+
|
225
260
|
# Opus encoded audio wrapped in an ogg container. The result will be a
|
226
261
|
# file which can be played natively on Android, and in browsers (at least
|
227
262
|
# Chrome and Firefox). The quality of the encoding is considerably higher
|
228
263
|
# than MP3 while using approximately the same bitrate.
|
229
264
|
OGG_OPUS = 3
|
265
|
+
|
266
|
+
# 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
|
267
|
+
# Audio content returned as MULAW also contains a WAV header.
|
268
|
+
MULAW = 5
|
230
269
|
end
|
231
270
|
end
|
232
271
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-text_to_speech-v1beta1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: google-cloud-errors
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,7 +162,6 @@ files:
|
|
162
162
|
- LICENSE.md
|
163
163
|
- README.md
|
164
164
|
- lib/google-cloud-text_to_speech-v1beta1.rb
|
165
|
-
- lib/google/cloud/common_resources_pb.rb
|
166
165
|
- lib/google/cloud/text_to_speech/v1beta1.rb
|
167
166
|
- lib/google/cloud/text_to_speech/v1beta1/text_to_speech.rb
|
168
167
|
- lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb
|
@@ -193,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
192
|
- !ruby/object:Gem::Version
|
194
193
|
version: '0'
|
195
194
|
requirements: []
|
196
|
-
rubygems_version: 3.
|
195
|
+
rubygems_version: 3.1.3
|
197
196
|
signing_key:
|
198
197
|
specification_version: 4
|
199
198
|
summary: API Client library for the Cloud Text-to-Speech V1beta1 API
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: google/cloud/common_resources.proto
|
3
|
-
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
|
-
require 'google/api/resource_pb'
|
7
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
|
-
add_file("google/cloud/common_resources.proto", :syntax => :proto3) do
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
module Google
|
13
|
-
module Cloud
|
14
|
-
end
|
15
|
-
end
|