Class: Google::Apis::CesV1::SynthesizeSpeechConfig

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/ces_v1/classes.rb,
lib/google/apis/ces_v1/representations.rb,
lib/google/apis/ces_v1/representations.rb

Overview

Configuration for how the agent response should be synthesized.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ SynthesizeSpeechConfig

Returns a new instance of SynthesizeSpeechConfig.



7754
7755
7756
# File 'lib/google/apis/ces_v1/classes.rb', line 7754

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

Optional. The Cloud Storage URI to the consent audio for voice cloning. Corresponds to the JSON property consentAudioGcsUri

Returns:

  • (String)


7717
7718
7719
# File 'lib/google/apis/ces_v1/classes.rb', line 7717

def consent_audio_gcs_uri
  @consent_audio_gcs_uri
end

#instructionString

Optional. The instruction used to synthesize speech when using a generative model. Corresponds to the JSON property instruction

Returns:

  • (String)


7723
7724
7725
# File 'lib/google/apis/ces_v1/classes.rb', line 7723

def instruction
  @instruction
end

#modelString

Optional. The model used to synthesize audio. Currently supported values: - " gemini-3.1-flash-tts-preview" If empty, Chirp3-HD is used. Corresponds to the JSON property model

Returns:

  • (String)


7729
7730
7731
# File 'lib/google/apis/ces_v1/classes.rb', line 7729

def model
  @model
end

#speaking_rateFloat

Optional. The speaking rate/speed in the range [0.25, 2.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast. Values outside of the range [0.25, 2.0] will return an error. Corresponds to the JSON property speakingRate

Returns:

  • (Float)


7736
7737
7738
# File 'lib/google/apis/ces_v1/classes.rb', line 7736

def speaking_rate
  @speaking_rate
end

#voiceString

Optional. The name of the voice. If not set, the service will choose a voice based on the other parameters such as language_code. For the list of available voices, please refer to Supported voices and languages from Cloud Text-to-Speech. Corresponds to the JSON property voice

Returns:

  • (String)


7744
7745
7746
# File 'lib/google/apis/ces_v1/classes.rb', line 7744

def voice
  @voice
end

#voice_sample_gcs_uriString

Optional. The Cloud Storage URI to the audio sample for voice cloning. The audio sample should be a mono-channel, 24kHz WAV file. Note: Please make sure the CES service agent service-@gcp-sa-ces.iam.gserviceaccount.com has storage.objects.get permission to the Cloud Storage object. Corresponds to the JSON property voiceSampleGcsUri

Returns:

  • (String)


7752
7753
7754
# File 'lib/google/apis/ces_v1/classes.rb', line 7752

def voice_sample_gcs_uri
  @voice_sample_gcs_uri
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



7759
7760
7761
7762
7763
7764
7765
7766
# File 'lib/google/apis/ces_v1/classes.rb', line 7759

def update!(**args)
  @consent_audio_gcs_uri = args[:consent_audio_gcs_uri] if args.key?(:consent_audio_gcs_uri)
  @instruction = args[:instruction] if args.key?(:instruction)
  @model = args[:model] if args.key?(:model)
  @speaking_rate = args[:speaking_rate] if args.key?(:speaking_rate)
  @voice = args[:voice] if args.key?(:voice)
  @voice_sample_gcs_uri = args[:voice_sample_gcs_uri] if args.key?(:voice_sample_gcs_uri)
end