public static final class SynthesisInput.Builder extends com.google.protobuf.GeneratedMessageV3.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| Modifier and Type | Method and Description |
|---|---|
SynthesisInput.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
SynthesisInput |
build() |
SynthesisInput |
buildPartial() |
SynthesisInput.Builder |
clear() |
SynthesisInput.Builder |
clearCustomPronunciations()
Optional.
|
SynthesisInput.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
SynthesisInput.Builder |
clearInputSource() |
SynthesisInput.Builder |
clearMultiSpeakerMarkup()
The multi-speaker input to be synthesized.
|
SynthesisInput.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
SynthesisInput.Builder |
clearSsml()
The SSML document to be synthesized.
|
SynthesisInput.Builder |
clearText()
The raw text to be synthesized.
|
SynthesisInput.Builder |
clone() |
CustomPronunciations |
getCustomPronunciations()
Optional.
|
CustomPronunciations.Builder |
getCustomPronunciationsBuilder()
Optional.
|
CustomPronunciationsOrBuilder |
getCustomPronunciationsOrBuilder()
Optional.
|
SynthesisInput |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
SynthesisInput.InputSourceCase |
getInputSourceCase() |
MultiSpeakerMarkup |
getMultiSpeakerMarkup()
The multi-speaker input to be synthesized.
|
MultiSpeakerMarkup.Builder |
getMultiSpeakerMarkupBuilder()
The multi-speaker input to be synthesized.
|
MultiSpeakerMarkupOrBuilder |
getMultiSpeakerMarkupOrBuilder()
The multi-speaker input to be synthesized.
|
String |
getSsml()
The SSML document to be synthesized.
|
com.google.protobuf.ByteString |
getSsmlBytes()
The SSML document to be synthesized.
|
String |
getText()
The raw text to be synthesized.
|
com.google.protobuf.ByteString |
getTextBytes()
The raw text to be synthesized.
|
boolean |
hasCustomPronunciations()
Optional.
|
boolean |
hasMultiSpeakerMarkup()
The multi-speaker input to be synthesized.
|
boolean |
hasSsml()
The SSML document to be synthesized.
|
boolean |
hasText()
The raw text to be synthesized.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
SynthesisInput.Builder |
mergeCustomPronunciations(CustomPronunciations value)
Optional.
|
SynthesisInput.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
SynthesisInput.Builder |
mergeFrom(com.google.protobuf.Message other) |
SynthesisInput.Builder |
mergeFrom(SynthesisInput other) |
SynthesisInput.Builder |
mergeMultiSpeakerMarkup(MultiSpeakerMarkup value)
The multi-speaker input to be synthesized.
|
SynthesisInput.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
SynthesisInput.Builder |
setCustomPronunciations(CustomPronunciations.Builder builderForValue)
Optional.
|
SynthesisInput.Builder |
setCustomPronunciations(CustomPronunciations value)
Optional.
|
SynthesisInput.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
SynthesisInput.Builder |
setMultiSpeakerMarkup(MultiSpeakerMarkup.Builder builderForValue)
The multi-speaker input to be synthesized.
|
SynthesisInput.Builder |
setMultiSpeakerMarkup(MultiSpeakerMarkup value)
The multi-speaker input to be synthesized.
|
SynthesisInput.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
SynthesisInput.Builder |
setSsml(String value)
The SSML document to be synthesized.
|
SynthesisInput.Builder |
setSsmlBytes(com.google.protobuf.ByteString value)
The SSML document to be synthesized.
|
SynthesisInput.Builder |
setText(String value)
The raw text to be synthesized.
|
SynthesisInput.Builder |
setTextBytes(com.google.protobuf.ByteString value)
The raw text to be synthesized.
|
SynthesisInput.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>public SynthesisInput.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>public SynthesisInput getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic SynthesisInput build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic SynthesisInput buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic SynthesisInput.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>public SynthesisInput.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>public SynthesisInput.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>public SynthesisInput.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>public SynthesisInput.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>public SynthesisInput.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>public SynthesisInput.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<SynthesisInput.Builder>public SynthesisInput.Builder mergeFrom(SynthesisInput other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>public SynthesisInput.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<SynthesisInput.Builder>IOExceptionpublic SynthesisInput.InputSourceCase getInputSourceCase()
getInputSourceCase in interface SynthesisInputOrBuilderpublic SynthesisInput.Builder clearInputSource()
public boolean hasText()
The raw text to be synthesized.
string text = 1;hasText in interface SynthesisInputOrBuilderpublic String getText()
The raw text to be synthesized.
string text = 1;getText in interface SynthesisInputOrBuilderpublic com.google.protobuf.ByteString getTextBytes()
The raw text to be synthesized.
string text = 1;getTextBytes in interface SynthesisInputOrBuilderpublic SynthesisInput.Builder setText(String value)
The raw text to be synthesized.
string text = 1;value - The text to set.public SynthesisInput.Builder clearText()
The raw text to be synthesized.
string text = 1;public SynthesisInput.Builder setTextBytes(com.google.protobuf.ByteString value)
The raw text to be synthesized.
string text = 1;value - The bytes for text to set.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;hasSsml in interface SynthesisInputOrBuilderpublic String 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;getSsml in interface SynthesisInputOrBuilderpublic 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;getSsmlBytes in interface SynthesisInputOrBuilderpublic SynthesisInput.Builder setSsml(String value)
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;value - The ssml to set.public SynthesisInput.Builder 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;public SynthesisInput.Builder setSsmlBytes(com.google.protobuf.ByteString value)
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;value - The bytes for ssml to set.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;hasMultiSpeakerMarkup in interface SynthesisInputOrBuilderpublic MultiSpeakerMarkup getMultiSpeakerMarkup()
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4;getMultiSpeakerMarkup in interface SynthesisInputOrBuilderpublic SynthesisInput.Builder setMultiSpeakerMarkup(MultiSpeakerMarkup value)
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4;public SynthesisInput.Builder setMultiSpeakerMarkup(MultiSpeakerMarkup.Builder builderForValue)
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4;public SynthesisInput.Builder mergeMultiSpeakerMarkup(MultiSpeakerMarkup value)
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4;public SynthesisInput.Builder clearMultiSpeakerMarkup()
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4;public MultiSpeakerMarkup.Builder getMultiSpeakerMarkupBuilder()
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4;public MultiSpeakerMarkupOrBuilder getMultiSpeakerMarkupOrBuilder()
The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
.google.cloud.texttospeech.v1.MultiSpeakerMarkup multi_speaker_markup = 4;getMultiSpeakerMarkupOrBuilder in interface SynthesisInputOrBuilderpublic boolean hasCustomPronunciations()
Optional. The pronunciation customizations to be applied to the input. If this is set, the input will be synthesized using the given pronunciation customizations. The initial support will be for EFIGS (English, French, Italian, German, Spanish) languages, as provided in VoiceSelectionParams. Journey and Instant Clone voices are not supported yet. 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 (entirely or partially).
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL];
hasCustomPronunciations in interface SynthesisInputOrBuilderpublic CustomPronunciations getCustomPronunciations()
Optional. The pronunciation customizations to be applied to the input. If this is set, the input will be synthesized using the given pronunciation customizations. The initial support will be for EFIGS (English, French, Italian, German, Spanish) languages, as provided in VoiceSelectionParams. Journey and Instant Clone voices are not supported yet. 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 (entirely or partially).
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL];
getCustomPronunciations in interface SynthesisInputOrBuilderpublic SynthesisInput.Builder setCustomPronunciations(CustomPronunciations value)
Optional. The pronunciation customizations to be applied to the input. If this is set, the input will be synthesized using the given pronunciation customizations. The initial support will be for EFIGS (English, French, Italian, German, Spanish) languages, as provided in VoiceSelectionParams. Journey and Instant Clone voices are not supported yet. 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 (entirely or partially).
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL];
public SynthesisInput.Builder setCustomPronunciations(CustomPronunciations.Builder builderForValue)
Optional. The pronunciation customizations to be applied to the input. If this is set, the input will be synthesized using the given pronunciation customizations. The initial support will be for EFIGS (English, French, Italian, German, Spanish) languages, as provided in VoiceSelectionParams. Journey and Instant Clone voices are not supported yet. 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 (entirely or partially).
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL];
public SynthesisInput.Builder mergeCustomPronunciations(CustomPronunciations value)
Optional. The pronunciation customizations to be applied to the input. If this is set, the input will be synthesized using the given pronunciation customizations. The initial support will be for EFIGS (English, French, Italian, German, Spanish) languages, as provided in VoiceSelectionParams. Journey and Instant Clone voices are not supported yet. 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 (entirely or partially).
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL];
public SynthesisInput.Builder clearCustomPronunciations()
Optional. The pronunciation customizations to be applied to the input. If this is set, the input will be synthesized using the given pronunciation customizations. The initial support will be for EFIGS (English, French, Italian, German, Spanish) languages, as provided in VoiceSelectionParams. Journey and Instant Clone voices are not supported yet. 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 (entirely or partially).
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL];
public CustomPronunciations.Builder getCustomPronunciationsBuilder()
Optional. The pronunciation customizations to be applied to the input. If this is set, the input will be synthesized using the given pronunciation customizations. The initial support will be for EFIGS (English, French, Italian, German, Spanish) languages, as provided in VoiceSelectionParams. Journey and Instant Clone voices are not supported yet. 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 (entirely or partially).
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL];
public CustomPronunciationsOrBuilder getCustomPronunciationsOrBuilder()
Optional. The pronunciation customizations to be applied to the input. If this is set, the input will be synthesized using the given pronunciation customizations. The initial support will be for EFIGS (English, French, Italian, German, Spanish) languages, as provided in VoiceSelectionParams. Journey and Instant Clone voices are not supported yet. 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 (entirely or partially).
.google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL];
getCustomPronunciationsOrBuilder in interface SynthesisInputOrBuilderpublic final SynthesisInput.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>public final SynthesisInput.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<SynthesisInput.Builder>Copyright © 2025 Google LLC. All rights reserved.