Class VoiceSelectionParams.Builder (2.49.0)

public static final class VoiceSelectionParams.Builder extends GeneratedMessageV3.Builder<VoiceSelectionParams.Builder> implements VoiceSelectionParamsOrBuilder

Description of which voice to use for a synthesis request.

Protobuf type google.cloud.texttospeech.v1beta1.VoiceSelectionParams

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public VoiceSelectionParams.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
VoiceSelectionParams.Builder
Overrides

build()

public VoiceSelectionParams build()
Returns
Type Description
VoiceSelectionParams

buildPartial()

public VoiceSelectionParams buildPartial()
Returns
Type Description
VoiceSelectionParams

clear()

public VoiceSelectionParams.Builder clear()
Returns
Type Description
VoiceSelectionParams.Builder
Overrides

clearCustomVoice()

public VoiceSelectionParams.Builder clearCustomVoice()

The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration.

.google.cloud.texttospeech.v1beta1.CustomVoiceParams custom_voice = 4;

Returns
Type Description
VoiceSelectionParams.Builder

clearField(Descriptors.FieldDescriptor field)

public VoiceSelectionParams.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
VoiceSelectionParams.Builder
Overrides

clearLanguageCode()

public VoiceSelectionParams.Builder clearLanguageCode()

Required. The language (and potentially also the region) of the voice expressed as a BCP-47 language tag, e.g. "en-US". This should not include a script tag (e.g. use "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using "nb" (Norwegian Bokmal) instead of "no" (Norwegian)".

string language_code = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
VoiceSelectionParams.Builder

This builder for chaining.

clearName()

public VoiceSelectionParams.Builder clearName()

The name of the voice. If both the name and the gender are not set, the service will choose a voice based on the other parameters such as language_code.

string name = 2;

Returns
Type Description
VoiceSelectionParams.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public VoiceSelectionParams.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
VoiceSelectionParams.Builder
Overrides

clearSsmlGender()

public VoiceSelectionParams.Builder clearSsmlGender()

The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not requirement; if a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.

.google.cloud.texttospeech.v1beta1.SsmlVoiceGender ssml_gender = 3;

Returns
Type Description
VoiceSelectionParams.Builder

This builder for chaining.

clone()

public VoiceSelectionParams.Builder clone()
Returns
Type Description
VoiceSelectionParams.Builder
Overrides

getCustomVoice()

public CustomVoiceParams getCustomVoice()

The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration.

.google.cloud.texttospeech.v1beta1.CustomVoiceParams custom_voice = 4;

Returns
Type Description
CustomVoiceParams

The customVoice.

getCustomVoiceBuilder()

public CustomVoiceParams.Builder getCustomVoiceBuilder()

The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration.

.google.cloud.texttospeech.v1beta1.CustomVoiceParams custom_voice = 4;

Returns
Type Description
CustomVoiceParams.Builder

getCustomVoiceOrBuilder()

public CustomVoiceParamsOrBuilder getCustomVoiceOrBuilder()

The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration.

.google.cloud.texttospeech.v1beta1.CustomVoiceParams custom_voice = 4;

Returns
Type Description
CustomVoiceParamsOrBuilder

getDefaultInstanceForType()

public VoiceSelectionParams getDefaultInstanceForType()
Returns
Type Description
VoiceSelectionParams

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getLanguageCode()

public String getLanguageCode()

Required. The language (and potentially also the region) of the voice expressed as a BCP-47 language tag, e.g. "en-US". This should not include a script tag (e.g. use "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using "nb" (Norwegian Bokmal) instead of "no" (Norwegian)".

string language_code = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The languageCode.

getLanguageCodeBytes()

public ByteString getLanguageCodeBytes()

Required. The language (and potentially also the region) of the voice expressed as a BCP-47 language tag, e.g. "en-US". This should not include a script tag (e.g. use "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using "nb" (Norwegian Bokmal) instead of "no" (Norwegian)".

string language_code = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for languageCode.

getName()

public String getName()

The name of the voice. If both the name and the gender are not set, the service will choose a voice based on the other parameters such as language_code.

string name = 2;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The name of the voice. If both the name and the gender are not set, the service will choose a voice based on the other parameters such as language_code.

string name = 2;

Returns
Type Description
ByteString

The bytes for name.

getSsmlGender()

public SsmlVoiceGender getSsmlGender()

The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not requirement; if a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.

.google.cloud.texttospeech.v1beta1.SsmlVoiceGender ssml_gender = 3;

Returns
Type Description
SsmlVoiceGender

The ssmlGender.

getSsmlGenderValue()

public int getSsmlGenderValue()

The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not requirement; if a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.

.google.cloud.texttospeech.v1beta1.SsmlVoiceGender ssml_gender = 3;

Returns
Type Description
int

The enum numeric value on the wire for ssmlGender.

hasCustomVoice()

public boolean hasCustomVoice()

The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration.

.google.cloud.texttospeech.v1beta1.CustomVoiceParams custom_voice = 4;

Returns
Type Description
boolean

Whether the customVoice field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeCustomVoice(CustomVoiceParams value)

public VoiceSelectionParams.Builder mergeCustomVoice(CustomVoiceParams value)

The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration.

.google.cloud.texttospeech.v1beta1.CustomVoiceParams custom_voice = 4;

Parameter
Name Description
value CustomVoiceParams
Returns
Type Description
VoiceSelectionParams.Builder

mergeFrom(VoiceSelectionParams other)

public VoiceSelectionParams.Builder mergeFrom(VoiceSelectionParams other)
Parameter
Name Description
other VoiceSelectionParams
Returns
Type Description
VoiceSelectionParams.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public VoiceSelectionParams.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
VoiceSelectionParams.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public VoiceSelectionParams.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
VoiceSelectionParams.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final VoiceSelectionParams.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
VoiceSelectionParams.Builder
Overrides

setCustomVoice(CustomVoiceParams value)

public VoiceSelectionParams.Builder setCustomVoice(CustomVoiceParams value)

The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration.

.google.cloud.texttospeech.v1beta1.CustomVoiceParams custom_voice = 4;

Parameter
Name Description
value CustomVoiceParams
Returns
Type Description
VoiceSelectionParams.Builder

setCustomVoice(CustomVoiceParams.Builder builderForValue)

public VoiceSelectionParams.Builder setCustomVoice(CustomVoiceParams.Builder builderForValue)

The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration.

.google.cloud.texttospeech.v1beta1.CustomVoiceParams custom_voice = 4;

Parameter
Name Description
builderForValue CustomVoiceParams.Builder
Returns
Type Description
VoiceSelectionParams.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public VoiceSelectionParams.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
VoiceSelectionParams.Builder
Overrides

setLanguageCode(String value)

public VoiceSelectionParams.Builder setLanguageCode(String value)

Required. The language (and potentially also the region) of the voice expressed as a BCP-47 language tag, e.g. "en-US". This should not include a script tag (e.g. use "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using "nb" (Norwegian Bokmal) instead of "no" (Norwegian)".

string language_code = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The languageCode to set.

Returns
Type Description
VoiceSelectionParams.Builder

This builder for chaining.

setLanguageCodeBytes(ByteString value)

public VoiceSelectionParams.Builder setLanguageCodeBytes(ByteString value)

Required. The language (and potentially also the region) of the voice expressed as a BCP-47 language tag, e.g. "en-US". This should not include a script tag (e.g. use "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using "nb" (Norwegian Bokmal) instead of "no" (Norwegian)".

string language_code = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes for languageCode to set.

Returns
Type Description
VoiceSelectionParams.Builder

This builder for chaining.

setName(String value)

public VoiceSelectionParams.Builder setName(String value)

The name of the voice. If both the name and the gender are not set, the service will choose a voice based on the other parameters such as language_code.

string name = 2;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
VoiceSelectionParams.Builder

This builder for chaining.

setNameBytes(ByteString value)

public VoiceSelectionParams.Builder setNameBytes(ByteString value)

The name of the voice. If both the name and the gender are not set, the service will choose a voice based on the other parameters such as language_code.

string name = 2;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
VoiceSelectionParams.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public VoiceSelectionParams.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
VoiceSelectionParams.Builder
Overrides

setSsmlGender(SsmlVoiceGender value)

public VoiceSelectionParams.Builder setSsmlGender(SsmlVoiceGender value)

The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not requirement; if a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.

.google.cloud.texttospeech.v1beta1.SsmlVoiceGender ssml_gender = 3;

Parameter
Name Description
value SsmlVoiceGender

The ssmlGender to set.

Returns
Type Description
VoiceSelectionParams.Builder

This builder for chaining.

setSsmlGenderValue(int value)

public VoiceSelectionParams.Builder setSsmlGenderValue(int value)

The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not requirement; if a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.

.google.cloud.texttospeech.v1beta1.SsmlVoiceGender ssml_gender = 3;

Parameter
Name Description
value int

The enum numeric value on the wire for ssmlGender to set.

Returns
Type Description
VoiceSelectionParams.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final VoiceSelectionParams.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
VoiceSelectionParams.Builder
Overrides