Cloud Text-to-Speech V1beta1 API - Class Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client (v0.12.1)

Reference documentation and code samples for the Cloud Text-to-Speech V1beta1 API class Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.

REST client for the TextToSpeechLongAudioSynthesize service.

Service that implements Google Cloud Text-to-Speech API.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the TextToSpeechLongAudioSynthesize Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all TextToSpeechLongAudioSynthesize clients
::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the TextToSpeechLongAudioSynthesize Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#initialize

def initialize() { |config| ... } -> Client

Create a new TextToSpeechLongAudioSynthesize REST client object.

Yields
  • (config) — Configure the TextToSpeechLongAudioSynthesize client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config|
  config.timeout = 10.0
end

#operations_client

def operations_client() -> ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Operations

Get the associated client for long-running operations.

#synthesize_long_audio

def synthesize_long_audio(request, options = nil) -> ::Gapic::Operation
def synthesize_long_audio(parent: nil, input: nil, audio_config: nil, output_gcs_uri: nil, voice: nil) -> ::Gapic::Operation

Synthesizes long form text asynchronously.

Overloads
def synthesize_long_audio(request, options = nil) -> ::Gapic::Operation
Pass arguments to synthesize_long_audio via a request object, either of type SynthesizeLongAudioRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def synthesize_long_audio(parent: nil, input: nil, audio_config: nil, output_gcs_uri: nil, voice: nil) -> ::Gapic::Operation
Pass arguments to synthesize_long_audio via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/text_to_speech/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new

# Call the synthesize_long_audio method.
result = client.synthesize_long_audio request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end