google-cloud-text_to_speech-v1beta1 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de81ebff9ea7cd6621d4a721f17e3eab7a999a4d2a745f7b15914cd98de08454
4
- data.tar.gz: bb83d38936d6c19ada12a2ace7bdbe0ae8b98df660a23889da4e6f59e8e2d711
3
+ metadata.gz: d641484c040acc5612330fcd3336326b919ee740a96a55abdf1f6ee6259cecc4
4
+ data.tar.gz: 377c277c1cdfe163ed133a30f2e9644a0ec0e307724643fc793a72ddb408edce
5
5
  SHA512:
6
- metadata.gz: a1a947d91523a2a8fc068fb60e5ec65e3bbc699b021a7d8728572f1c4ef6c1f13eb8669eb7907da34b3883419fedcafd580459fed3164453dad060a2f2f08733
7
- data.tar.gz: 3fdc08ed0306d8fb3876680437bc98c32730b05f75fe639287ddf1f3b23a30790465b26887076cdedac40197e44f2d98ebc432b7dd8210a5e3a7060923d03634
6
+ metadata.gz: c4e9df912f93491bad478ffc3d51f08cae080121fa334e76f156da7bfdb4ba2c0019f2e70edf011d16c31bdfb8cea5453207b6a797b73e648540e8b9659a743c
7
+ data.tar.gz: f91220cb7a6c9f7dba598b20880d4c025947beb3ed8e34f13609ab1463a608f0162408a10825d1254c5260457c5a46aa994783852069256cf4e2b8a993fb43f4
data/README.md CHANGED
@@ -6,6 +6,12 @@ Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input in
6
6
 
7
7
  https://github.com/googleapis/google-cloud-ruby
8
8
 
9
+ This gem is a _versioned_ client. It provides basic client classes for a
10
+ specific version of the Cloud Text-to-Speech V1beta1 API. Most users should consider using
11
+ the main client gem,
12
+ [google-cloud-text_to_speech](https://rubygems.org/gems/google-cloud-text_to_speech).
13
+ See the section below titled *Which client should I use?* for more information.
14
+
9
15
  ## Installation
10
16
 
11
17
  ```
@@ -18,6 +24,7 @@ In order to use this library, you first need to go through the following steps:
18
24
 
19
25
  1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
20
26
  1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
27
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/texttospeech.googleapis.com)
21
28
  1. {file:AUTHENTICATION.md Set up authentication.}
22
29
 
23
30
  ## Quick Start
@@ -33,6 +40,9 @@ response = client.list_voices request
33
40
  View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-text_to_speech-v1beta1/latest)
34
41
  for class and method documentation.
35
42
 
43
+ See also the [Product Documentation](https://cloud.google.com/text-to-speech)
44
+ for general usage information.
45
+
36
46
  ## Enabling Logging
37
47
 
38
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
@@ -69,3 +79,61 @@ in security maintenance, and not end of life. Currently, this means Ruby 2.4
69
79
  and later. Older versions of Ruby _may_ still work, but are unsupported and not
70
80
  recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
71
81
  about the Ruby support schedule.
82
+
83
+ ## Which client should I use?
84
+
85
+ Most modern Ruby client libraries for Google APIs come in two flavors: the main
86
+ client library with a name such as `google-cloud-text_to_speech`,
87
+ and lower-level _versioned_ client libraries with names such as
88
+ `google-cloud-text_to_speech-v1beta1`.
89
+ _In most cases, you should install the main client._
90
+
91
+ ### What's the difference between the main client and a versioned client?
92
+
93
+ A _versioned client_ provides a basic set of data types and client classes for
94
+ a _single version_ of a specific service. (That is, for a service with multiple
95
+ versions, there might be a separate versioned client for each service version.)
96
+ Most versioned clients are written and maintained by a code generator.
97
+
98
+ The _main client_ is designed to provide you with the _recommended_ client
99
+ interfaces for the service. There will be only one main client for any given
100
+ service, even a service with multiple versions. The main client includes
101
+ factory methods for constructing the client objects we recommend for most
102
+ users. In some cases, those will be classes provided by an underlying versioned
103
+ client; in other cases, they will be handwritten higher-level client objects
104
+ with additional capabilities, convenience methods, or best practices built in.
105
+ Generally, the main client will default to a recommended service version,
106
+ although in some cases you can override this if you need to talk to a specific
107
+ service version.
108
+
109
+ ### Why would I want to use the main client?
110
+
111
+ We recommend that most users install the main client gem for a service. You can
112
+ identify this gem as the one _without_ a version in its name, e.g.
113
+ `google-cloud-text_to_speech`.
114
+ The main client is recommended because it will embody the best practices for
115
+ accessing the service, and may also provide more convenient interfaces or
116
+ tighter integration into frameworks and third-party libraries. In addition, the
117
+ documentation and samples published by Google will generally demonstrate use of
118
+ the main client.
119
+
120
+ ### Why would I want to use a versioned client?
121
+
122
+ You can use a versioned client if you are content with a possibly lower-level
123
+ class interface, you explicitly want to avoid features provided by the main
124
+ client, or you want to access a specific service version not be covered by the
125
+ main client. You can identify versioned client gems because the service version
126
+ is part of the name, e.g. `google-cloud-text_to_speech-v1beta1`.
127
+
128
+ ### What about the google-apis-<name> clients?
129
+
130
+ Client library gems with names that begin with `google-apis-` are based on an
131
+ older code generation technology. They talk to a REST/JSON backend (whereas
132
+ most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may
133
+ not offer the same performance, features, and ease of use provided by more
134
+ modern clients.
135
+
136
+ The `google-apis-` clients have wide coverage across Google services, so you
137
+ might need to use one if there is no modern client available for the service.
138
+ However, if a modern client is available, we generally recommend it over the
139
+ older `google-apis-` clients.
@@ -33,3 +33,6 @@ module Google
33
33
  end
34
34
  end
35
35
  end
36
+
37
+ helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb"
38
+ require "google/cloud/text_to_speech/v1beta1/_helpers" if ::File.file? helper_path
@@ -63,20 +63,12 @@ module Google
63
63
  end
64
64
  default_config = Client::Configuration.new parent_config
65
65
 
66
- default_config.rpcs.list_voices.timeout = 600.0
67
- default_config.rpcs.list_voices.retry_policy = {
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: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
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
@@ -140,7 +132,13 @@ module Google
140
132
 
141
133
  # Create credentials
142
134
  credentials = @config.credentials
143
- credentials ||= Credentials.default scope: @config.scope
135
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
136
+ # but only if the default endpoint does not have a region prefix.
137
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
138
+ @config.endpoint == Client.configure.endpoint &&
139
+ !@config.endpoint.split(".").first.include?("-")
140
+ credentials ||= Credentials.default scope: @config.scope,
141
+ enable_self_signed_jwt: enable_self_signed_jwt
144
142
  if credentials.is_a?(String) || credentials.is_a?(Hash)
145
143
  credentials = Credentials.new credentials, scope: @config.scope
146
144
  end
@@ -181,10 +179,10 @@ module Google
181
179
  # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If
182
180
  # specified, the ListVoices call will only return voices that can be used to
183
181
  # synthesize this language_code. E.g. when specifying "en-NZ", you will get
184
- # supported "en-*" voices; when specifying "no", you will get supported
185
- # "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh"
186
- # will also get supported "cmn-*" voices; specifying "zh-hk" will also get
187
- # supported "yue-*" voices.
182
+ # supported "en-\*" voices; when specifying "no", you will get supported
183
+ # "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh"
184
+ # will also get supported "cmn-\*" voices; specifying "zh-hk" will also get
185
+ # supported "yue-\*" voices.
188
186
  #
189
187
  # @yield [response, operation] Access the result along with the RPC operation
190
188
  # @yieldparam response [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse]
@@ -239,7 +237,7 @@ module Google
239
237
  # @param options [::Gapic::CallOptions, ::Hash]
240
238
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
241
239
  #
242
- # @overload synthesize_speech(input: nil, voice: nil, audio_config: nil)
240
+ # @overload synthesize_speech(input: nil, voice: nil, audio_config: nil, enable_time_pointing: nil)
243
241
  # Pass arguments to `synthesize_speech` via keyword arguments. Note that at
244
242
  # least one keyword argument is required. To specify no parameters, or to keep all
245
243
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -250,6 +248,8 @@ module Google
250
248
  # Required. The desired voice of the synthesized audio.
251
249
  # @param audio_config [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig, ::Hash]
252
250
  # Required. The configuration of the synthesized audio.
251
+ # @param enable_time_pointing [::Array<::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest::TimepointType>]
252
+ # Whether and what timepoints should be returned in the response.
253
253
  #
254
254
  # @yield [response, operation] Access the result along with the RPC operation
255
255
  # @yieldparam response [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse]
@@ -375,7 +375,7 @@ module Google
375
375
 
376
376
  config_attr :endpoint, "texttospeech.googleapis.com", ::String
377
377
  config_attr :credentials, nil do |value|
378
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
378
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
379
379
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
380
380
  allowed.any? { |klass| klass === value }
381
381
  end
@@ -415,7 +415,7 @@ module Google
415
415
  # Each configuration object is of type `Gapic::Config::Method` and includes
416
416
  # the following configuration fields:
417
417
  #
418
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
418
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
419
419
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
420
420
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
421
421
  # include the following keys:
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module TextToSpeech
23
23
  module V1beta1
24
- VERSION = "0.2.2"
24
+ VERSION = "0.4.0"
25
25
  end
26
26
  end
27
27
  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
@@ -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/v1beta1/cloud_tts_pb'
@@ -35,10 +34,10 @@ module Google
35
34
  self.service_name = 'google.cloud.texttospeech.v1beta1.TextToSpeech'
36
35
 
37
36
  # Returns a list of Voice supported for synthesis.
38
- rpc :ListVoices, Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest, Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse
37
+ rpc :ListVoices, ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest, ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse
39
38
  # Synthesizes speech synchronously: receive results after all text input
40
39
  # has been processed.
41
- rpc :SynthesizeSpeech, Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest, Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse
40
+ rpc :SynthesizeSpeech, ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest, ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse
42
41
  end
43
42
 
44
43
  Stub = Service.rpc_stub_class
@@ -54,6 +54,12 @@ module Google
54
54
  # This indicates that the field may be set once in a request to create a
55
55
  # resource, but may not be changed thereafter.
56
56
  IMMUTABLE = 5
57
+
58
+ # Denotes that a (repeated) field is an unordered list.
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
61
+ # provided. Additionally, the list's order may or may not be stable.
62
+ UNORDERED_LIST = 6
57
63
  end
58
64
  end
59
65
  end
@@ -43,12 +43,12 @@ module Google
43
43
  #
44
44
  # The ResourceDescriptor Yaml config will look like:
45
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}"
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
52
  #
53
53
  # Sometimes, resources have multiple patterns, typically because they can
54
54
  # live under multiple parents.
@@ -183,15 +183,24 @@ module Google
183
183
  # }
184
184
  # @!attribute [rw] plural
185
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
186
+ # The plural name used in the resource name and permission names, such as
187
+ # 'projects' for the resource name of 'projects/\\{project}' and the permission
188
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
189
+ # concept of the `plural` field in k8s CRD spec
189
190
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
191
+ #
192
+ # Note: The plural form is required even for singleton resources. See
193
+ # https://aip.dev/156
190
194
  # @!attribute [rw] singular
191
195
  # @return [::String]
192
196
  # The same concept of the `singular` field in k8s CRD spec
193
197
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
198
  # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
199
+ # @!attribute [rw] style
200
+ # @return [::Array<::Google::Api::ResourceDescriptor::Style>]
201
+ # Style flag(s) for this resource.
202
+ # These indicate that a resource is expected to conform to a given
203
+ # style. See the specific style flags for additional information.
195
204
  class ResourceDescriptor
196
205
  include ::Google::Protobuf::MessageExts
197
206
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -211,6 +220,22 @@ module Google
211
220
  # that from being necessary once there are multiple patterns.)
212
221
  FUTURE_MULTI_PATTERN = 2
213
222
  end
223
+
224
+ # A flag representing a specific style that a resource claims to conform to.
225
+ module Style
226
+ # The unspecified value. Do not use.
227
+ STYLE_UNSPECIFIED = 0
228
+
229
+ # This resource is intended to be "declarative-friendly".
230
+ #
231
+ # Declarative-friendly resources must be more strictly consistent, and
232
+ # setting this to true communicates to tools that this resource should
233
+ # adhere to declarative-friendly expectations.
234
+ #
235
+ # Note: This is used by the API linter (linter.aip.dev) to enable
236
+ # additional checks.
237
+ DECLARATIVE_FRIENDLY = 1
238
+ end
214
239
  end
215
240
 
216
241
  # Defines a proto annotation that describes a string field that refers to
@@ -226,6 +251,17 @@ module Google
226
251
  # type: "pubsub.googleapis.com/Topic"
227
252
  # }];
228
253
  # }
254
+ #
255
+ # Occasionally, a field may reference an arbitrary resource. In this case,
256
+ # APIs use the special value * in their resource reference.
257
+ #
258
+ # Example:
259
+ #
260
+ # message GetIamPolicyRequest {
261
+ # string resource = 2 [(google.api.resource_reference) = {
262
+ # type: "*"
263
+ # }];
264
+ # }
229
265
  # @!attribute [rw] child_type
230
266
  # @return [::String]
231
267
  # The resource type of a child collection that the annotated field
@@ -234,11 +270,11 @@ module Google
234
270
  #
235
271
  # Example:
236
272
  #
237
- # message ListLogEntriesRequest {
238
- # string parent = 1 [(google.api.resource_reference) = {
239
- # child_type: "logging.googleapis.com/LogEntry"
240
- # };
241
- # }
273
+ # message ListLogEntriesRequest {
274
+ # string parent = 1 [(google.api.resource_reference) = {
275
+ # child_type: "logging.googleapis.com/LogEntry"
276
+ # };
277
+ # }
242
278
  class ResourceReference
243
279
  include ::Google::Protobuf::MessageExts
244
280
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -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-*" 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.
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
@@ -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.2.2
4
+ version: 0.4.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: 2020-06-05 00:00:00.000000000 Z
11
+ date: 2021-02-02 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.2'
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.2'
26
+ version: '0.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: google-cloud-errors
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +151,10 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0.9'
153
153
  description: Text-to-Speech converts text or Speech Synthesis Markup Language (SSML)
154
- input into audio data of natural human speech.
154
+ input into audio data of natural human speech. Note that google-cloud-text_to_speech-v1beta1
155
+ is a version-specific client library. For most uses, we recommend installing the
156
+ main client library google-cloud-text_to_speech instead. See the readme for more
157
+ details.
155
158
  email: googleapis-packages@google.com
156
159
  executables: []
157
160
  extensions: []
@@ -192,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
195
  - !ruby/object:Gem::Version
193
196
  version: '0'
194
197
  requirements: []
195
- rubygems_version: 3.1.3
198
+ rubygems_version: 3.2.6
196
199
  signing_key:
197
200
  specification_version: 4
198
201
  summary: API Client library for the Cloud Text-to-Speech V1beta1 API