Class: Google::Apis::TexttospeechV1::SynthesisInput

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

Overview

Contains text input to be synthesized. Either text or ssml must be supplied. Supplying both or neither returns google.rpc.Code.INVALID_ARGUMENT. The input size is limited to 5000 bytes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ SynthesisInput

Returns a new instance of SynthesisInput.



540
541
542
# File 'lib/google/apis/texttospeech_v1/classes.rb', line 540

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

Instance Attribute Details

#custom_pronunciationsGoogle::Apis::TexttospeechV1::CustomPronunciations

A collection of pronunciation customizations. Corresponds to the JSON property customPronunciations



525
526
527
# File 'lib/google/apis/texttospeech_v1/classes.rb', line 525

def custom_pronunciations
  @custom_pronunciations
end

#ssmlString

The SSML document to be synthesized. The SSML document must be valid and well- formed. Otherwise the RPC will fail and return google.rpc.Code. INVALID_ARGUMENT. For more information, see SSML. Corresponds to the JSON property ssml

Returns:

  • (String)


533
534
535
# File 'lib/google/apis/texttospeech_v1/classes.rb', line 533

def ssml
  @ssml
end

#textString

The raw text to be synthesized. Corresponds to the JSON property text

Returns:

  • (String)


538
539
540
# File 'lib/google/apis/texttospeech_v1/classes.rb', line 538

def text
  @text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



545
546
547
548
549
# File 'lib/google/apis/texttospeech_v1/classes.rb', line 545

def update!(**args)
  @custom_pronunciations = args[:custom_pronunciations] if args.key?(:custom_pronunciations)
  @ssml = args[:ssml] if args.key?(:ssml)
  @text = args[:text] if args.key?(:text)
end