Class AudioConfig.Builder (2.9.0)

public static final class AudioConfig.Builder extends GeneratedMessageV3.Builder<AudioConfig.Builder> implements AudioConfigOrBuilder

Description of audio data to be synthesized.

Protobuf type google.cloud.texttospeech.v1.AudioConfig

Static Methods

getDescriptor()

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

Methods

addAllEffectsProfileId(Iterable<String> values)

public AudioConfig.Builder addAllEffectsProfileId(Iterable<String> values)

Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See audio profiles for current supported profile ids.

repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuesIterable<String>

The effectsProfileId to add.

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

addEffectsProfileId(String value)

public AudioConfig.Builder addEffectsProfileId(String value)

Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See audio profiles for current supported profile ids.

repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueString

The effectsProfileId to add.

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

addEffectsProfileIdBytes(ByteString value)

public AudioConfig.Builder addEffectsProfileIdBytes(ByteString value)

Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See audio profiles for current supported profile ids.

repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueByteString

The bytes of the effectsProfileId to add.

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public AudioConfig build()
Returns
TypeDescription
AudioConfig

buildPartial()

public AudioConfig buildPartial()
Returns
TypeDescription
AudioConfig

clear()

public AudioConfig.Builder clear()
Returns
TypeDescription
AudioConfig.Builder
Overrides

clearAudioEncoding()

public AudioConfig.Builder clearAudioEncoding()

Required. The format of the audio byte stream.

.google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

clearEffectsProfileId()

public AudioConfig.Builder clearEffectsProfileId()

Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See audio profiles for current supported profile ids.

repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public AudioConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
AudioConfig.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public AudioConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
AudioConfig.Builder
Overrides

clearPitch()

public AudioConfig.Builder clearPitch()

Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch.

double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

clearSampleRateHertz()

public AudioConfig.Builder clearSampleRateHertz()

Optional. The synthesis sample rate (in hertz) for this audio. When this is specified in SynthesizeSpeechRequest, if this is different from the voice's natural sample rate, then the synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality), unless the specified sample rate is not supported for the encoding chosen, in which case it will fail the request and return google.rpc.Code.INVALID_ARGUMENT.

int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

clearSpeakingRate()

public AudioConfig.Builder clearSpeakingRate()

Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other values < 0.25 or > 4.0 will return an error.

double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

clearVolumeGainDb()

public AudioConfig.Builder clearVolumeGainDb()

Optional. Input only. Volume gain (in dB) of the normal native volume supported by the specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) will play at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) will play at approximately twice the amplitude of the normal native signal amplitude. Strongly recommend not to exceed +10 (dB) as there's usually no effective increase in loudness for any value greater than that.

double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

clone()

public AudioConfig.Builder clone()
Returns
TypeDescription
AudioConfig.Builder
Overrides

getAudioEncoding()

public AudioEncoding getAudioEncoding()

Required. The format of the audio byte stream.

.google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
AudioEncoding

The audioEncoding.

getAudioEncodingValue()

public int getAudioEncodingValue()

Required. The format of the audio byte stream.

.google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
int

The enum numeric value on the wire for audioEncoding.

getDefaultInstanceForType()

public AudioConfig getDefaultInstanceForType()
Returns
TypeDescription
AudioConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getEffectsProfileId(int index)

public String getEffectsProfileId(int index)

Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See audio profiles for current supported profile ids.

repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The effectsProfileId at the given index.

getEffectsProfileIdBytes(int index)

public ByteString getEffectsProfileIdBytes(int index)

Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See audio profiles for current supported profile ids.

repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the effectsProfileId at the given index.

getEffectsProfileIdCount()

public int getEffectsProfileIdCount()

Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See audio profiles for current supported profile ids.

repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

The count of effectsProfileId.

getEffectsProfileIdList()

public ProtocolStringList getEffectsProfileIdList()

Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See audio profiles for current supported profile ids.

repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ProtocolStringList

A list containing the effectsProfileId.

getPitch()

public double getPitch()

Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch.

double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
double

The pitch.

getSampleRateHertz()

public int getSampleRateHertz()

Optional. The synthesis sample rate (in hertz) for this audio. When this is specified in SynthesizeSpeechRequest, if this is different from the voice's natural sample rate, then the synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality), unless the specified sample rate is not supported for the encoding chosen, in which case it will fail the request and return google.rpc.Code.INVALID_ARGUMENT.

int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

The sampleRateHertz.

getSpeakingRate()

public double getSpeakingRate()

Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other values < 0.25 or > 4.0 will return an error.

double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
double

The speakingRate.

getVolumeGainDb()

public double getVolumeGainDb()

Optional. Input only. Volume gain (in dB) of the normal native volume supported by the specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) will play at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) will play at approximately twice the amplitude of the normal native signal amplitude. Strongly recommend not to exceed +10 (dB) as there's usually no effective increase in loudness for any value greater than that.

double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
double

The volumeGainDb.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(AudioConfig other)

public AudioConfig.Builder mergeFrom(AudioConfig other)
Parameter
NameDescription
otherAudioConfig
Returns
TypeDescription
AudioConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AudioConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
AudioConfig.Builder
Overrides

setAudioEncoding(AudioEncoding value)

public AudioConfig.Builder setAudioEncoding(AudioEncoding value)

Required. The format of the audio byte stream.

.google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueAudioEncoding

The audioEncoding to set.

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

setAudioEncodingValue(int value)

public AudioConfig.Builder setAudioEncodingValue(int value)

Required. The format of the audio byte stream.

.google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueint

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

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

setEffectsProfileId(int index, String value)

public AudioConfig.Builder setEffectsProfileId(int index, String value)

Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See audio profiles for current supported profile ids.

repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The effectsProfileId to set.

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setPitch(double value)

public AudioConfig.Builder setPitch(double value)

Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch.

double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuedouble

The pitch to set.

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

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

public AudioConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
AudioConfig.Builder
Overrides

setSampleRateHertz(int value)

public AudioConfig.Builder setSampleRateHertz(int value)

Optional. The synthesis sample rate (in hertz) for this audio. When this is specified in SynthesizeSpeechRequest, if this is different from the voice's natural sample rate, then the synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality), unless the specified sample rate is not supported for the encoding chosen, in which case it will fail the request and return google.rpc.Code.INVALID_ARGUMENT.

int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueint

The sampleRateHertz to set.

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

setSpeakingRate(double value)

public AudioConfig.Builder setSpeakingRate(double value)

Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other values < 0.25 or > 4.0 will return an error.

double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuedouble

The speakingRate to set.

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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

setVolumeGainDb(double value)

public AudioConfig.Builder setVolumeGainDb(double value)

Optional. Input only. Volume gain (in dB) of the normal native volume supported by the specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) will play at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) will play at approximately twice the amplitude of the normal native signal amplitude. Strongly recommend not to exceed +10 (dB) as there's usually no effective increase in loudness for any value greater than that.

double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuedouble

The volumeGainDb to set.

Returns
TypeDescription
AudioConfig.Builder

This builder for chaining.