google-cloud-text_to_speech-v1 1.0.0 → 1.1.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: 3a4a63954c0a21208c09e16606e1fe148d85a06afe2a9af5e77ead5c5f8d9514
4
- data.tar.gz: e2215c6c3be946b7be9a658e8236f6f557a5f63291c36e262ba8f91efa33e113
3
+ metadata.gz: 53001d13867b604e70ba6bd591e02008a1b88f9d5a84bd998a319e98afee2da3
4
+ data.tar.gz: be69902b4e684df46613e098b4e5e494f64d29bf7a976582c1e395ed63218241
5
5
  SHA512:
6
- metadata.gz: e90ad6bab7e8ab5946706bd894b845b0d5262da79e654a5c8cf3791f2602b87e431526426589ae916fb31eafd25e2aa3dfb71c538747ea3d59e0e4eec57ac5cb
7
- data.tar.gz: 48818b9fe11cafd0811cb8b122840ccb703906ab97d6f84a5cbdebd996a27b593c1b8d17ed594a8eb9cfe206ae443f4b09c3c299eeb927ff145ad21b9c5ccc04
6
+ metadata.gz: 17a58a1662714310be718a134dd2e2bca4f1704087dbae4dbcbe97f61a86b41d8b55f90e97d3671ee805cf0e206f6044d97b59ec2a589c7a00bcfcfb9ff7ca2f
7
+ data.tar.gz: 758ff02e89e2fad352e85db60f91a522baf6ee8d89986f7ec1f48fac01ca4dcb5676a999e6e3070cf1f4ce1e55826f069c582673191e315e8cccd7345200529e
@@ -336,6 +336,86 @@ module Google
336
336
  raise ::Google::Cloud::Error.from_error(e)
337
337
  end
338
338
 
339
+ ##
340
+ # Performs bidirectional streaming speech synthesis: receive audio while
341
+ # sending text.
342
+ #
343
+ # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest, ::Hash>]
344
+ # An enumerable of {::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest} instances.
345
+ # @param options [::Gapic::CallOptions, ::Hash]
346
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
347
+ #
348
+ # @yield [response, operation] Access the result along with the RPC operation
349
+ # @yieldparam response [::Enumerable<::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse>]
350
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
351
+ #
352
+ # @return [::Enumerable<::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse>]
353
+ #
354
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
355
+ #
356
+ # @example Basic example
357
+ # require "google/cloud/text_to_speech/v1"
358
+ #
359
+ # # Create a client object. The client can be reused for multiple calls.
360
+ # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new
361
+ #
362
+ # # Create an input stream.
363
+ # input = Gapic::StreamInput.new
364
+ #
365
+ # # Call the streaming_synthesize method to start streaming.
366
+ # output = client.streaming_synthesize input
367
+ #
368
+ # # Send requests on the stream. For each request object, set fields by
369
+ # # passing keyword arguments. Be sure to close the stream when done.
370
+ # input << Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new
371
+ # input << Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new
372
+ # input.close
373
+ #
374
+ # # The returned object is a streamed enumerable yielding elements of type
375
+ # # ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse
376
+ # output.each do |current_response|
377
+ # p current_response
378
+ # end
379
+ #
380
+ def streaming_synthesize request, options = nil
381
+ unless request.is_a? ::Enumerable
382
+ raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
383
+ request = request.to_enum
384
+ end
385
+
386
+ request = request.lazy.map do |req|
387
+ ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest
388
+ end
389
+
390
+ # Converts hash and nil to an options object
391
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
392
+
393
+ # Customize the options with defaults
394
+ metadata = @config.rpcs.streaming_synthesize.metadata.to_h
395
+
396
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
397
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
398
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
399
+ gapic_version: ::Google::Cloud::TextToSpeech::V1::VERSION
400
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
401
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
402
+
403
+ options.apply_defaults timeout: @config.rpcs.streaming_synthesize.timeout,
404
+ metadata: metadata,
405
+ retry_policy: @config.rpcs.streaming_synthesize.retry_policy
406
+
407
+ options.apply_defaults timeout: @config.timeout,
408
+ metadata: @config.metadata,
409
+ retry_policy: @config.retry_policy
410
+
411
+ @text_to_speech_stub.call_rpc :streaming_synthesize, request, options: options do |response, operation|
412
+ yield response, operation if block_given?
413
+ return response
414
+ end
415
+ rescue ::GRPC::BadStatus => e
416
+ raise ::Google::Cloud::Error.from_error(e)
417
+ end
418
+
339
419
  ##
340
420
  # Configuration class for the TextToSpeech API.
341
421
  #
@@ -499,6 +579,11 @@ module Google
499
579
  # @return [::Gapic::Config::Method]
500
580
  #
501
581
  attr_reader :synthesize_speech
582
+ ##
583
+ # RPC-specific configuration for `streaming_synthesize`
584
+ # @return [::Gapic::Config::Method]
585
+ #
586
+ attr_reader :streaming_synthesize
502
587
 
503
588
  # @private
504
589
  def initialize parent_rpcs = nil
@@ -506,6 +591,8 @@ module Google
506
591
  @list_voices = ::Gapic::Config::Method.new list_voices_config
507
592
  synthesize_speech_config = parent_rpcs.synthesize_speech if parent_rpcs.respond_to? :synthesize_speech
508
593
  @synthesize_speech = ::Gapic::Config::Method.new synthesize_speech_config
594
+ streaming_synthesize_config = parent_rpcs.streaming_synthesize if parent_rpcs.respond_to? :streaming_synthesize
595
+ @streaming_synthesize = ::Gapic::Config::Method.new streaming_synthesize_config
509
596
 
510
597
  yield self if block_given?
511
598
  end
@@ -202,7 +202,6 @@ module Google
202
202
  # `projects/*/locations/*`.
203
203
  # @param input [::Google::Cloud::TextToSpeech::V1::SynthesisInput, ::Hash]
204
204
  # Required. The Synthesizer requires either plain text or SSML as input.
205
- # While Long Audio is in preview, SSML is temporarily unsupported.
206
205
  # @param audio_config [::Google::Cloud::TextToSpeech::V1::AudioConfig, ::Hash]
207
206
  # Required. The configuration of the synthesized audio.
208
207
  # @param output_gcs_uri [::String]
@@ -195,7 +195,6 @@ module Google
195
195
  # `projects/*/locations/*`.
196
196
  # @param input [::Google::Cloud::TextToSpeech::V1::SynthesisInput, ::Hash]
197
197
  # Required. The Synthesizer requires either plain text or SSML as input.
198
- # While Long Audio is in preview, SSML is temporarily unsupported.
199
198
  # @param audio_config [::Google::Cloud::TextToSpeech::V1::AudioConfig, ::Hash]
200
199
  # Required. The configuration of the synthesized audio.
201
200
  # @param output_gcs_uri [::String]
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module TextToSpeech
23
23
  module V1
24
- VERSION = "1.0.0"
24
+ VERSION = "1.1.0"
25
25
  end
26
26
  end
27
27
  end
@@ -10,7 +10,7 @@ require 'google/api/field_behavior_pb'
10
10
  require 'google/api/resource_pb'
11
11
 
12
12
 
13
- descriptor_data = "\n,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1cgoogle.cloud.texttospeech.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"/\n\x11ListVoicesRequest\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x01\"I\n\x12ListVoicesResponse\x12\x33\n\x06voices\x18\x01 \x03(\x0b\x32#.google.cloud.texttospeech.v1.Voice\"\x94\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\xe9\x01\n\x17SynthesizeSpeechRequest\x12@\n\x05input\x18\x01 \x01(\x0b\x32,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xe0\x41\x02\x12\x46\n\x05voice\x18\x02 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12\x44\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32).google.cloud.texttospeech.v1.AudioConfigB\x03\xe0\x41\x02\"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source\"\xcb\x01\n\x14VoiceSelectionParams\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12\x45\n\x0c\x63ustom_voice\x18\x04 \x01(\x0b\x32/.google.cloud.texttospeech.v1.CustomVoiceParams\"\xf1\x01\n\x0b\x41udioConfig\x12H\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xe0\x41\x02\x12\x1d\n\rspeaking_rate\x18\x02 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x15\n\x05pitch\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x0evolume_gain_db\x18\x04 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\"\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\tB\x06\xe0\x41\x04\xe0\x41\x01\"\xf1\x01\n\x11\x43ustomVoiceParams\x12\x32\n\x05model\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12\\\n\x0ereported_usage\x18\x03 \x01(\x0e\x32=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xe0\x41\x01\"J\n\rReportedUsage\x12\x1e\n\x1aREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0c\n\x08REALTIME\x10\x01\x12\x0b\n\x07OFFLINE\x10\x02\"1\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*i\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0c\n\x08OGG_OPUS\x10\x03\x12\t\n\x05MULAW\x10\x05\x12\x08\n\x04\x41LAW\x10\x06\x32\xb4\x03\n\x0cTextToSpeech\x12\x93\x01\n\nListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1a\x30.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xda\x41\rlanguage_code\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/voices\x12\xbc\x01\n\x10SynthesizeSpeech\x12\x35.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1a\x36.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xda\x41\x18input,voice,audio_config\x82\xd3\xe4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb8\x02\n com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xf8\x01\x01\xaa\x02\x1cGoogle.Cloud.TextToSpeech.V1\xca\x02\x1cGoogle\\Cloud\\TextToSpeech\\V1\xea\x02\x1fGoogle::Cloud::TextToSpeech::V1\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}b\x06proto3"
13
+ descriptor_data = "\n,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1cgoogle.cloud.texttospeech.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"/\n\x11ListVoicesRequest\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x01\"I\n\x12ListVoicesResponse\x12\x33\n\x06voices\x18\x01 \x03(\x0b\x32#.google.cloud.texttospeech.v1.Voice\"\x94\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\xe9\x01\n\x17SynthesizeSpeechRequest\x12@\n\x05input\x18\x01 \x01(\x0b\x32,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xe0\x41\x02\x12\x46\n\x05voice\x18\x02 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12\x44\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32).google.cloud.texttospeech.v1.AudioConfigB\x03\xe0\x41\x02\"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source\"\xcb\x01\n\x14VoiceSelectionParams\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12\x45\n\x0c\x63ustom_voice\x18\x04 \x01(\x0b\x32/.google.cloud.texttospeech.v1.CustomVoiceParams\"\xf1\x01\n\x0b\x41udioConfig\x12H\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xe0\x41\x02\x12\x1d\n\rspeaking_rate\x18\x02 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x15\n\x05pitch\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x0evolume_gain_db\x18\x04 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\"\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\tB\x06\xe0\x41\x04\xe0\x41\x01\"\xf1\x01\n\x11\x43ustomVoiceParams\x12\x32\n\x05model\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12\\\n\x0ereported_usage\x18\x03 \x01(\x0e\x32=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xe0\x41\x01\"J\n\rReportedUsage\x12\x1e\n\x1aREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0c\n\x08REALTIME\x10\x01\x12\x0b\n\x07OFFLINE\x10\x02\"1\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c\"c\n\x19StreamingSynthesizeConfig\x12\x46\n\x05voice\x18\x01 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xe0\x41\x02\"9\n\x17StreamingSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x42\x0e\n\x0cinput_source\"\xce\x01\n\x1aStreamingSynthesizeRequest\x12S\n\x10streaming_config\x18\x01 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12\x46\n\x05input\x18\x02 \x01(\x0b\x32\x35.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00\x42\x13\n\x11streaming_request\"4\n\x1bStreamingSynthesizeResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*i\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0c\n\x08OGG_OPUS\x10\x03\x12\t\n\x05MULAW\x10\x05\x12\x08\n\x04\x41LAW\x10\x06\x32\xc7\x04\n\x0cTextToSpeech\x12\x93\x01\n\nListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1a\x30.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xda\x41\rlanguage_code\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/voices\x12\xbc\x01\n\x10SynthesizeSpeech\x12\x35.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1a\x36.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xda\x41\x18input,voice,audio_config\x82\xd3\xe4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\n\x13StreamingSynthesize\x12\x38.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1a\x39.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x01\x30\x01\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbf\x02\n com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xf8\x01\x01\xa2\x02\x04\x43TTS\xaa\x02\x1cGoogle.Cloud.TextToSpeech.V1\xca\x02\x1cGoogle\\Cloud\\TextToSpeech\\V1\xea\x02\x1fGoogle::Cloud::TextToSpeech::V1\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}b\x06proto3"
14
14
 
15
15
  pool = Google::Protobuf::DescriptorPool.generated_pool
16
16
 
@@ -50,6 +50,10 @@ module Google
50
50
  CustomVoiceParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomVoiceParams").msgclass
51
51
  CustomVoiceParams::ReportedUsage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage").enummodule
52
52
  SynthesizeSpeechResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeSpeechResponse").msgclass
53
+ StreamingSynthesizeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesizeConfig").msgclass
54
+ StreamingSynthesisInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesisInput").msgclass
55
+ StreamingSynthesizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesizeRequest").msgclass
56
+ StreamingSynthesizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesizeResponse").msgclass
53
57
  SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SsmlVoiceGender").enummodule
54
58
  AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.AudioEncoding").enummodule
55
59
  end
@@ -38,6 +38,9 @@ module Google
38
38
  # Synthesizes speech synchronously: receive results after all text input
39
39
  # has been processed.
40
40
  rpc :SynthesizeSpeech, ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest, ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse
41
+ # Performs bidirectional streaming speech synthesis: receive audio while
42
+ # sending text.
43
+ rpc :StreamingSynthesize, stream(::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest), stream(::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse)
41
44
  end
42
45
 
43
46
  Stub = Service.rpc_stub_class
@@ -290,6 +290,13 @@ module Google
290
290
  # @return [::String]
291
291
  # The fully qualified name of the method, for which the options below apply.
292
292
  # This is used to find the method to apply the options.
293
+ #
294
+ # Example:
295
+ #
296
+ # publishing:
297
+ # method_settings:
298
+ # - selector: google.storage.control.v2.StorageControl.CreateFolder
299
+ # # method settings for CreateFolder...
293
300
  # @!attribute [rw] long_running
294
301
  # @return [::Google::Api::MethodSettings::LongRunning]
295
302
  # Describes settings to use for long-running operations when generating
@@ -298,17 +305,14 @@ module Google
298
305
  #
299
306
  # Example of a YAML configuration::
300
307
  #
301
- # publishing:
302
- # method_settings:
308
+ # publishing:
309
+ # method_settings:
303
310
  # - selector: google.cloud.speech.v2.Speech.BatchRecognize
304
311
  # long_running:
305
- # initial_poll_delay:
306
- # seconds: 60 # 1 minute
312
+ # initial_poll_delay: 60s # 1 minute
307
313
  # poll_delay_multiplier: 1.5
308
- # max_poll_delay:
309
- # seconds: 360 # 6 minutes
310
- # total_poll_timeout:
311
- # seconds: 54000 # 90 minutes
314
+ # max_poll_delay: 360s # 6 minutes
315
+ # total_poll_timeout: 54000s # 90 minutes
312
316
  # @!attribute [rw] auto_populated_fields
313
317
  # @return [::Array<::String>]
314
318
  # List of top-level fields of the request message, that should be
@@ -317,8 +321,8 @@ module Google
317
321
  #
318
322
  # Example of a YAML configuration:
319
323
  #
320
- # publishing:
321
- # method_settings:
324
+ # publishing:
325
+ # method_settings:
322
326
  # - selector: google.example.v1.ExampleService.CreateExample
323
327
  # auto_populated_fields:
324
328
  # - request_id
@@ -124,8 +124,13 @@ module Google
124
124
  # @return [::String]
125
125
  # The plural name used in the resource name and permission names, such as
126
126
  # 'projects' for the resource name of 'projects/\\{project}' and the permission
127
- # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
128
- # concept of the `plural` field in k8s CRD spec
127
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
128
+ # to this is for Nested Collections that have stuttering names, as defined
129
+ # in [AIP-122](https://google.aip.dev/122#nested-collections), where the
130
+ # collection ID in the resource name pattern does not necessarily directly
131
+ # match the `plural` value.
132
+ #
133
+ # It is the same concept of the `plural` field in k8s CRD spec
129
134
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
130
135
  #
131
136
  # Note: The plural form is required even for singleton resources. See
@@ -116,8 +116,9 @@ module Google
116
116
  # Bokmal) instead of "no" (Norwegian)".
117
117
  # @!attribute [rw] name
118
118
  # @return [::String]
119
- # The name of the voice. If not set, the service will choose a
120
- # voice based on the other parameters such as language_code and gender.
119
+ # The name of the voice. If both the name and the gender are not set,
120
+ # the service will choose a voice based on the other parameters such as
121
+ # language_code.
121
122
  # @!attribute [rw] ssml_gender
122
123
  # @return [::Google::Cloud::TextToSpeech::V1::SsmlVoiceGender]
123
124
  # The preferred gender of the voice. If not set, the service will
@@ -224,6 +225,57 @@ module Google
224
225
  extend ::Google::Protobuf::MessageExts::ClassMethods
225
226
  end
226
227
 
228
+ # Provides configuration information for the StreamingSynthesize request.
229
+ # @!attribute [rw] voice
230
+ # @return [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams]
231
+ # Required. The desired voice of the synthesized audio.
232
+ class StreamingSynthesizeConfig
233
+ include ::Google::Protobuf::MessageExts
234
+ extend ::Google::Protobuf::MessageExts::ClassMethods
235
+ end
236
+
237
+ # Input to be synthesized.
238
+ # @!attribute [rw] text
239
+ # @return [::String]
240
+ # The raw text to be synthesized. It is recommended that each input
241
+ # contains complete, terminating sentences, as this will likely result in
242
+ # better prosody in the output audio. That being said, users are free to
243
+ # input text however they please.
244
+ class StreamingSynthesisInput
245
+ include ::Google::Protobuf::MessageExts
246
+ extend ::Google::Protobuf::MessageExts::ClassMethods
247
+ end
248
+
249
+ # Request message for the `StreamingSynthesize` method. Multiple
250
+ # `StreamingSynthesizeRequest` messages are sent in one call.
251
+ # The first message must contain a `streaming_config` that
252
+ # fully specifies the request configuration and must not contain `input`. All
253
+ # subsequent messages must only have `input` set.
254
+ # @!attribute [rw] streaming_config
255
+ # @return [::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeConfig]
256
+ # StreamingSynthesizeConfig to be used in this streaming attempt. Only
257
+ # specified in the first message sent in a `StreamingSynthesize` call.
258
+ # @!attribute [rw] input
259
+ # @return [::Google::Cloud::TextToSpeech::V1::StreamingSynthesisInput]
260
+ # Input to synthesize. Specified in all messages but the first in a
261
+ # `StreamingSynthesize` call.
262
+ class StreamingSynthesizeRequest
263
+ include ::Google::Protobuf::MessageExts
264
+ extend ::Google::Protobuf::MessageExts::ClassMethods
265
+ end
266
+
267
+ # `StreamingSynthesizeResponse` is the only message returned to the
268
+ # client by `StreamingSynthesize` method. A series of zero or more
269
+ # `StreamingSynthesizeResponse` messages are streamed back to the client.
270
+ # @!attribute [rw] audio_content
271
+ # @return [::String]
272
+ # The audio data bytes encoded as specified in the request. This is
273
+ # headerless LINEAR16 audio with a sample rate of 24000.
274
+ class StreamingSynthesizeResponse
275
+ include ::Google::Protobuf::MessageExts
276
+ extend ::Google::Protobuf::MessageExts::ClassMethods
277
+ end
278
+
227
279
  # Gender of the voice as described in
228
280
  # [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice).
229
281
  module SsmlVoiceGender
@@ -30,7 +30,6 @@ module Google
30
30
  # @!attribute [rw] input
31
31
  # @return [::Google::Cloud::TextToSpeech::V1::SynthesisInput]
32
32
  # Required. The Synthesizer requires either plain text or SSML as input.
33
- # While Long Audio is in preview, SSML is temporarily unsupported.
34
33
  # @!attribute [rw] audio_config
35
34
  # @return [::Google::Cloud::TextToSpeech::V1::AudioConfig]
36
35
  # Required. The configuration of the synthesized audio.
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: 1.0.0
4
+ version: 1.1.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: 2024-07-08 00:00:00.000000000 Z
11
+ date: 2024-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common