Package com.google.cloud.texttospeech.v1
Class SynthesisInput.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<SynthesisInput.Builder>
com.google.cloud.texttospeech.v1.SynthesisInput.Builder
- All Implemented Interfaces:
SynthesisInputOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- SynthesisInput
public static final class SynthesisInput.Builder
extends com.google.protobuf.GeneratedMessage.Builder<SynthesisInput.Builder>
implements SynthesisInputOrBuilder
Contains text input to be synthesized. Either `text` or `ssml` must be supplied. Supplying both or neither returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. The input size is limited to 5000 bytes.Protobuf type
google.cloud.texttospeech.v1.SynthesisInput-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()Optional.Markup for Chirp 3: HD voices specifically.The multi-speaker input to be synthesized.This system instruction is supported only for controllable/promptable voice models.The SSML document to be synthesized.The raw text to be synthesized.Optional.Optional.Optional.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorMarkup for Chirp 3: HD voices specifically.com.google.protobuf.ByteStringMarkup for Chirp 3: HD voices specifically.The multi-speaker input to be synthesized.The multi-speaker input to be synthesized.The multi-speaker input to be synthesized.This system instruction is supported only for controllable/promptable voice models.com.google.protobuf.ByteStringThis system instruction is supported only for controllable/promptable voice models.getSsml()The SSML document to be synthesized.com.google.protobuf.ByteStringThe SSML document to be synthesized.getText()The raw text to be synthesized.com.google.protobuf.ByteStringThe raw text to be synthesized.booleanOptional.booleanMarkup for Chirp 3: HD voices specifically.booleanThe multi-speaker input to be synthesized.booleanThis system instruction is supported only for controllable/promptable voice models.booleanhasSsml()The SSML document to be synthesized.booleanhasText()The raw text to be synthesized.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanOptional.mergeFrom(SynthesisInput other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) The multi-speaker input to be synthesized.Optional.setCustomPronunciations(CustomPronunciations.Builder builderForValue) Optional.Markup for Chirp 3: HD voices specifically.setMarkupBytes(com.google.protobuf.ByteString value) Markup for Chirp 3: HD voices specifically.The multi-speaker input to be synthesized.setMultiSpeakerMarkup(MultiSpeakerMarkup.Builder builderForValue) The multi-speaker input to be synthesized.This system instruction is supported only for controllable/promptable voice models.setPromptBytes(com.google.protobuf.ByteString value) This system instruction is supported only for controllable/promptable voice models.The SSML document to be synthesized.setSsmlBytes(com.google.protobuf.ByteString value) The SSML document to be synthesized.The raw text to be synthesized.setTextBytes(com.google.protobuf.ByteString value) The raw text to be synthesized.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<SynthesisInput.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<SynthesisInput.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<SynthesisInput.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<SynthesisInput.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<SynthesisInput.Builder>
-
mergeFrom
public SynthesisInput.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<SynthesisInput.Builder>- Throws:
IOException
-
getInputSourceCase
- Specified by:
getInputSourceCasein interfaceSynthesisInputOrBuilder
-
clearInputSource
-
hasText
public boolean hasText()The raw text to be synthesized.
string text = 1;- Specified by:
hasTextin interfaceSynthesisInputOrBuilder- Returns:
- Whether the text field is set.
-
getText
The raw text to be synthesized.
string text = 1;- Specified by:
getTextin interfaceSynthesisInputOrBuilder- Returns:
- The text.
-
getTextBytes
public com.google.protobuf.ByteString getTextBytes()The raw text to be synthesized.
string text = 1;- Specified by:
getTextBytesin interfaceSynthesisInputOrBuilder- Returns:
- The bytes for text.
-
setText
The raw text to be synthesized.
string text = 1;- Parameters:
value- The text to set.- Returns:
- This builder for chaining.
-
clearText
The raw text to be synthesized.
string text = 1;- Returns:
- This builder for chaining.
-
setTextBytes
The raw text to be synthesized.
string text = 1;- Parameters:
value- The bytes for text to set.- Returns:
- This builder for chaining.
-
hasMarkup
public boolean hasMarkup()Markup for Chirp 3: HD voices specifically. This field may not be used with any other voices.
string markup = 5;- Specified by:
hasMarkupin interfaceSynthesisInputOrBuilder- Returns:
- Whether the markup field is set.
-
getMarkup
Markup for Chirp 3: HD voices specifically. This field may not be used with any other voices.
string markup = 5;- Specified by:
getMarkupin interfaceSynthesisInputOrBuilder- Returns:
- The markup.
-
getMarkupBytes
public com.google.protobuf.ByteString getMarkupBytes()Markup for Chirp 3: HD voices specifically. This field may not be used with any other voices.
string markup = 5;- Specified by:
getMarkupBytesin interfaceSynthesisInputOrBuilder- Returns:
- The bytes for markup.
-
setMarkup
Markup for Chirp 3: HD voices specifically. This field may not be used with any other voices.
string markup = 5;- Parameters:
value- The markup to set.- Returns:
- This builder for chaining.
-
clearMarkup
Markup for Chirp 3: HD voices specifically. This field may not be used with any other voices.
string markup = 5;- Returns:
- This builder for chaining.
-
setMarkupBytes
Markup for Chirp 3: HD voices specifically. This field may not be used with any other voices.
string markup = 5;- Parameters:
value- The bytes for markup to set.- Returns:
- This builder for chaining.
-
hasSsml
public boolean hasSsml()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][google.rpc.Code.INVALID_ARGUMENT]. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
string ssml = 2;- Specified by:
hasSsmlin interfaceSynthesisInputOrBuilder- Returns:
- Whether the ssml field is set.
-
getSsml
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][google.rpc.Code.INVALID_ARGUMENT]. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
string ssml = 2;- Specified by:
getSsmlin interfaceSynthesisInputOrBuilder- Returns:
- The ssml.
-
getSsmlBytes
public com.google.protobuf.ByteString getSsmlBytes()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][google.rpc.Code.INVALID_ARGUMENT]. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
string ssml = 2;- Specified by:
getSsmlBytesin interfaceSynthesisInputOrBuilder- Returns:
- The bytes for ssml.
-
setSsml
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][google.rpc.Code.INVALID_ARGUMENT]. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
string ssml = 2;- Parameters:
value- The ssml to set.- Returns:
- This builder for chaining.
-
clearSsml
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][google.rpc.Code.INVALID_ARGUMENT]. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
string ssml = 2;- Returns:
- This builder for chaining.
-
setSsmlBytes
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][google.rpc.Code.INVALID_ARGUMENT]. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
string ssml = 2;- Parameters:
value- The bytes for ssml to set.- Returns:
- This builder for chaining.
-
hasMultiSpeakerMarkup
public boolean hasMultiSpeakerMarkup()The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4;- Specified by:
hasMultiSpeakerMarkupin interfaceSynthesisInputOrBuilder- Returns:
- Whether the multiSpeakerMarkup field is set.
-
getMultiSpeakerMarkup
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4;- Specified by:
getMultiSpeakerMarkupin interfaceSynthesisInputOrBuilder- Returns:
- The multiSpeakerMarkup.
-
setMultiSpeakerMarkup
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; -
setMultiSpeakerMarkup
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; -
mergeMultiSpeakerMarkup
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; -
clearMultiSpeakerMarkup
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; -
getMultiSpeakerMarkupBuilder
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4; -
getMultiSpeakerMarkupOrBuilder
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4;- Specified by:
getMultiSpeakerMarkupOrBuilderin interfaceSynthesisInputOrBuilder
-
hasPrompt
public boolean hasPrompt()This system instruction is supported only for controllable/promptable voice models. If this system instruction is used, we pass the unedited text to Gemini-TTS. Otherwise, a default system instruction is used. AI Studio calls this system instruction, Style Instructions.
optional string prompt = 6;- Specified by:
hasPromptin interfaceSynthesisInputOrBuilder- Returns:
- Whether the prompt field is set.
-
getPrompt
This system instruction is supported only for controllable/promptable voice models. If this system instruction is used, we pass the unedited text to Gemini-TTS. Otherwise, a default system instruction is used. AI Studio calls this system instruction, Style Instructions.
optional string prompt = 6;- Specified by:
getPromptin interfaceSynthesisInputOrBuilder- Returns:
- The prompt.
-
getPromptBytes
public com.google.protobuf.ByteString getPromptBytes()This system instruction is supported only for controllable/promptable voice models. If this system instruction is used, we pass the unedited text to Gemini-TTS. Otherwise, a default system instruction is used. AI Studio calls this system instruction, Style Instructions.
optional string prompt = 6;- Specified by:
getPromptBytesin interfaceSynthesisInputOrBuilder- Returns:
- The bytes for prompt.
-
setPrompt
This system instruction is supported only for controllable/promptable voice models. If this system instruction is used, we pass the unedited text to Gemini-TTS. Otherwise, a default system instruction is used. AI Studio calls this system instruction, Style Instructions.
optional string prompt = 6;- Parameters:
value- The prompt to set.- Returns:
- This builder for chaining.
-
clearPrompt
This system instruction is supported only for controllable/promptable voice models. If this system instruction is used, we pass the unedited text to Gemini-TTS. Otherwise, a default system instruction is used. AI Studio calls this system instruction, Style Instructions.
optional string prompt = 6;- Returns:
- This builder for chaining.
-
setPromptBytes
This system instruction is supported only for controllable/promptable voice models. If this system instruction is used, we pass the unedited text to Gemini-TTS. Otherwise, a default system instruction is used. AI Studio calls this system instruction, Style Instructions.
optional string prompt = 6;- Parameters:
value- The bytes for prompt to set.- Returns:
- This builder for chaining.
-
hasCustomPronunciations
public boolean hasCustomPronunciations()Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
hasCustomPronunciationsin interfaceSynthesisInputOrBuilder- Returns:
- Whether the customPronunciations field is set.
-
getCustomPronunciations
Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getCustomPronunciationsin interfaceSynthesisInputOrBuilder- Returns:
- The customPronunciations.
-
setCustomPronunciations
Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; -
setCustomPronunciations
Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; -
mergeCustomPronunciations
Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; -
clearCustomPronunciations
Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; -
getCustomPronunciationsBuilder
Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; -
getCustomPronunciationsOrBuilder
Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getCustomPronunciationsOrBuilderin interfaceSynthesisInputOrBuilder
-