Class VoiceSelectionParams.Builder (2.38.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.v1.VoiceSelectionParams

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public VoiceSelectionParams.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
VoiceSelectionParams.Builder
Overrides

build()

public VoiceSelectionParams build()
Returns
TypeDescription
VoiceSelectionParams

buildPartial()

public VoiceSelectionParams buildPartial()
Returns
TypeDescription
VoiceSelectionParams

clear()

public VoiceSelectionParams.Builder clear()
Returns
TypeDescription
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.v1.CustomVoiceParams custom_voice = 4;

Returns
TypeDescription
VoiceSelectionParams.Builder

clearField(Descriptors.FieldDescriptor field)

public VoiceSelectionParams.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
VoiceSelectionParams.Builder

This builder for chaining.

clearName()

public VoiceSelectionParams.Builder clearName()

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

string name = 2;

Returns
TypeDescription
VoiceSelectionParams.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public VoiceSelectionParams.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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.v1.SsmlVoiceGender ssml_gender = 3;

Returns
TypeDescription
VoiceSelectionParams.Builder

This builder for chaining.

clone()

public VoiceSelectionParams.Builder clone()
Returns
TypeDescription
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.v1.CustomVoiceParams custom_voice = 4;

Returns
TypeDescription
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.v1.CustomVoiceParams custom_voice = 4;

Returns
TypeDescription
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.v1.CustomVoiceParams custom_voice = 4;

Returns
TypeDescription
CustomVoiceParamsOrBuilder

getDefaultInstanceForType()

public VoiceSelectionParams getDefaultInstanceForType()
Returns
TypeDescription
VoiceSelectionParams

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for languageCode.

getName()

public String getName()

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

string name = 2;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

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

string name = 2;

Returns
TypeDescription
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.v1.SsmlVoiceGender ssml_gender = 3;

Returns
TypeDescription
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.v1.SsmlVoiceGender ssml_gender = 3;

Returns
TypeDescription
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.v1.CustomVoiceParams custom_voice = 4;

Returns
TypeDescription
boolean

Whether the customVoice field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
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.v1.CustomVoiceParams custom_voice = 4;

Parameter
NameDescription
valueCustomVoiceParams
Returns
TypeDescription
VoiceSelectionParams.Builder

mergeFrom(VoiceSelectionParams other)

public VoiceSelectionParams.Builder mergeFrom(VoiceSelectionParams other)
Parameter
NameDescription
otherVoiceSelectionParams
Returns
TypeDescription
VoiceSelectionParams.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public VoiceSelectionParams.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
VoiceSelectionParams.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public VoiceSelectionParams.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
VoiceSelectionParams.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final VoiceSelectionParams.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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.v1.CustomVoiceParams custom_voice = 4;

Parameter
NameDescription
valueCustomVoiceParams
Returns
TypeDescription
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.v1.CustomVoiceParams custom_voice = 4;

Parameter
NameDescription
builderForValueCustomVoiceParams.Builder
Returns
TypeDescription
VoiceSelectionParams.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public VoiceSelectionParams.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The languageCode to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for languageCode to set.

Returns
TypeDescription
VoiceSelectionParams.Builder

This builder for chaining.

setName(String value)

public VoiceSelectionParams.Builder setName(String value)

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

string name = 2;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
VoiceSelectionParams.Builder

This builder for chaining.

setNameBytes(ByteString value)

public VoiceSelectionParams.Builder setNameBytes(ByteString value)

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

string name = 2;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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.v1.SsmlVoiceGender ssml_gender = 3;

Parameter
NameDescription
valueSsmlVoiceGender

The ssmlGender to set.

Returns
TypeDescription
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.v1.SsmlVoiceGender ssml_gender = 3;

Parameter
NameDescription
valueint

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

Returns
TypeDescription
VoiceSelectionParams.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final VoiceSelectionParams.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
VoiceSelectionParams.Builder
Overrides