Class TranslateSpeechConfig.Builder (0.30.0)

public static final class TranslateSpeechConfig.Builder extends GeneratedMessageV3.Builder<TranslateSpeechConfig.Builder> implements TranslateSpeechConfigOrBuilder

Provides information to the speech translation that specifies how to process the request.

Protobuf type google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public TranslateSpeechConfig build()
Returns
TypeDescription
TranslateSpeechConfig

buildPartial()

public TranslateSpeechConfig buildPartial()
Returns
TypeDescription
TranslateSpeechConfig

clear()

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

clearAudioEncoding()

public TranslateSpeechConfig.Builder clearAudioEncoding()

Required. Encoding of audio data. Supported formats:

  • linear16

    Uncompressed 16-bit signed little-endian samples (Linear PCM).

  • flac

    flac (Free Lossless Audio Codec) is the recommended encoding because it is lossless--therefore recognition is not compromised--and requires only about half the bandwidth of linear16.

  • mulaw

    8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.

  • amr

    Adaptive Multi-Rate Narrowband codec. sample_rate_hertz must be 8000.

  • amr-wb

    Adaptive Multi-Rate Wideband codec. sample_rate_hertz must be 16000.

  • ogg-opus

    Opus encoded audio frames in Ogg container. sample_rate_hertz must be one of 8000, 12000, 16000, 24000, or 48000.

  • mp3

    MP3 audio. Support all standard MP3 bitrates (which range from 32-320 kbps). When using this encoding, sample_rate_hertz has to match the sample rate of the file being used.

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

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearModel()

public TranslateSpeechConfig.Builder clearModel()

Optional. google-provided-model/video and google-provided-model/enhanced-phone-call are premium models. google-provided-model/phone-call is not premium model.

string model = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearSampleRateHertz()

public TranslateSpeechConfig.Builder clearSampleRateHertz()

Optional. Sample rate in Hertz of the audio data. Valid values are: 8000-48000. 16000 is optimal. For best results, set the sampling rate of the audio source to 16000 Hz. If that's not possible, use the native sample rate of the audio source (instead of re-sampling).

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

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

clearSourceLanguageCode()

public TranslateSpeechConfig.Builder clearSourceLanguageCode()

Required. Source language code (BCP-47) of the input audio.

string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

clearTargetLanguageCode()

public TranslateSpeechConfig.Builder clearTargetLanguageCode()

Required. Target language code (BCP-47) of the output.

string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

clone()

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

getAudioEncoding()

public String getAudioEncoding()

Required. Encoding of audio data. Supported formats:

  • linear16

    Uncompressed 16-bit signed little-endian samples (Linear PCM).

  • flac

    flac (Free Lossless Audio Codec) is the recommended encoding because it is lossless--therefore recognition is not compromised--and requires only about half the bandwidth of linear16.

  • mulaw

    8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.

  • amr

    Adaptive Multi-Rate Narrowband codec. sample_rate_hertz must be 8000.

  • amr-wb

    Adaptive Multi-Rate Wideband codec. sample_rate_hertz must be 16000.

  • ogg-opus

    Opus encoded audio frames in Ogg container. sample_rate_hertz must be one of 8000, 12000, 16000, 24000, or 48000.

  • mp3

    MP3 audio. Support all standard MP3 bitrates (which range from 32-320 kbps). When using this encoding, sample_rate_hertz has to match the sample rate of the file being used.

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

Returns
TypeDescription
String

The audioEncoding.

getAudioEncodingBytes()

public ByteString getAudioEncodingBytes()

Required. Encoding of audio data. Supported formats:

  • linear16

    Uncompressed 16-bit signed little-endian samples (Linear PCM).

  • flac

    flac (Free Lossless Audio Codec) is the recommended encoding because it is lossless--therefore recognition is not compromised--and requires only about half the bandwidth of linear16.

  • mulaw

    8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.

  • amr

    Adaptive Multi-Rate Narrowband codec. sample_rate_hertz must be 8000.

  • amr-wb

    Adaptive Multi-Rate Wideband codec. sample_rate_hertz must be 16000.

  • ogg-opus

    Opus encoded audio frames in Ogg container. sample_rate_hertz must be one of 8000, 12000, 16000, 24000, or 48000.

  • mp3

    MP3 audio. Support all standard MP3 bitrates (which range from 32-320 kbps). When using this encoding, sample_rate_hertz has to match the sample rate of the file being used.

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

Returns
TypeDescription
ByteString

The bytes for audioEncoding.

getDefaultInstanceForType()

public TranslateSpeechConfig getDefaultInstanceForType()
Returns
TypeDescription
TranslateSpeechConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getModel()

public String getModel()

Optional. google-provided-model/video and google-provided-model/enhanced-phone-call are premium models. google-provided-model/phone-call is not premium model.

string model = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
String

The model.

getModelBytes()

public ByteString getModelBytes()

Optional. google-provided-model/video and google-provided-model/enhanced-phone-call are premium models. google-provided-model/phone-call is not premium model.

string model = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ByteString

The bytes for model.

getSampleRateHertz()

public int getSampleRateHertz()

Optional. Sample rate in Hertz of the audio data. Valid values are: 8000-48000. 16000 is optimal. For best results, set the sampling rate of the audio source to 16000 Hz. If that's not possible, use the native sample rate of the audio source (instead of re-sampling).

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

Returns
TypeDescription
int

The sampleRateHertz.

getSourceLanguageCode()

public String getSourceLanguageCode()

Required. Source language code (BCP-47) of the input audio.

string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The sourceLanguageCode.

getSourceLanguageCodeBytes()

public ByteString getSourceLanguageCodeBytes()

Required. Source language code (BCP-47) of the input audio.

string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for sourceLanguageCode.

getTargetLanguageCode()

public String getTargetLanguageCode()

Required. Target language code (BCP-47) of the output.

string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The targetLanguageCode.

getTargetLanguageCodeBytes()

public ByteString getTargetLanguageCodeBytes()

Required. Target language code (BCP-47) of the output.

string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for targetLanguageCode.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(TranslateSpeechConfig other)

public TranslateSpeechConfig.Builder mergeFrom(TranslateSpeechConfig other)
Parameter
NameDescription
otherTranslateSpeechConfig
Returns
TypeDescription
TranslateSpeechConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setAudioEncoding(String value)

public TranslateSpeechConfig.Builder setAudioEncoding(String value)

Required. Encoding of audio data. Supported formats:

  • linear16

    Uncompressed 16-bit signed little-endian samples (Linear PCM).

  • flac

    flac (Free Lossless Audio Codec) is the recommended encoding because it is lossless--therefore recognition is not compromised--and requires only about half the bandwidth of linear16.

  • mulaw

    8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.

  • amr

    Adaptive Multi-Rate Narrowband codec. sample_rate_hertz must be 8000.

  • amr-wb

    Adaptive Multi-Rate Wideband codec. sample_rate_hertz must be 16000.

  • ogg-opus

    Opus encoded audio frames in Ogg container. sample_rate_hertz must be one of 8000, 12000, 16000, 24000, or 48000.

  • mp3

    MP3 audio. Support all standard MP3 bitrates (which range from 32-320 kbps). When using this encoding, sample_rate_hertz has to match the sample rate of the file being used.

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

Parameter
NameDescription
valueString

The audioEncoding to set.

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

setAudioEncodingBytes(ByteString value)

public TranslateSpeechConfig.Builder setAudioEncodingBytes(ByteString value)

Required. Encoding of audio data. Supported formats:

  • linear16

    Uncompressed 16-bit signed little-endian samples (Linear PCM).

  • flac

    flac (Free Lossless Audio Codec) is the recommended encoding because it is lossless--therefore recognition is not compromised--and requires only about half the bandwidth of linear16.

  • mulaw

    8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.

  • amr

    Adaptive Multi-Rate Narrowband codec. sample_rate_hertz must be 8000.

  • amr-wb

    Adaptive Multi-Rate Wideband codec. sample_rate_hertz must be 16000.

  • ogg-opus

    Opus encoded audio frames in Ogg container. sample_rate_hertz must be one of 8000, 12000, 16000, 24000, or 48000.

  • mp3

    MP3 audio. Support all standard MP3 bitrates (which range from 32-320 kbps). When using this encoding, sample_rate_hertz has to match the sample rate of the file being used.

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

Parameter
NameDescription
valueByteString

The bytes for audioEncoding to set.

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setModel(String value)

public TranslateSpeechConfig.Builder setModel(String value)

Optional. google-provided-model/video and google-provided-model/enhanced-phone-call are premium models. google-provided-model/phone-call is not premium model.

string model = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueString

The model to set.

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

setModelBytes(ByteString value)

public TranslateSpeechConfig.Builder setModelBytes(ByteString value)

Optional. google-provided-model/video and google-provided-model/enhanced-phone-call are premium models. google-provided-model/phone-call is not premium model.

string model = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueByteString

The bytes for model to set.

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

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

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

setSampleRateHertz(int value)

public TranslateSpeechConfig.Builder setSampleRateHertz(int value)

Optional. Sample rate in Hertz of the audio data. Valid values are: 8000-48000. 16000 is optimal. For best results, set the sampling rate of the audio source to 16000 Hz. If that's not possible, use the native sample rate of the audio source (instead of re-sampling).

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

Parameter
NameDescription
valueint

The sampleRateHertz to set.

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

setSourceLanguageCode(String value)

public TranslateSpeechConfig.Builder setSourceLanguageCode(String value)

Required. Source language code (BCP-47) of the input audio.

string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The sourceLanguageCode to set.

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

setSourceLanguageCodeBytes(ByteString value)

public TranslateSpeechConfig.Builder setSourceLanguageCodeBytes(ByteString value)

Required. Source language code (BCP-47) of the input audio.

string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes for sourceLanguageCode to set.

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

setTargetLanguageCode(String value)

public TranslateSpeechConfig.Builder setTargetLanguageCode(String value)

Required. Target language code (BCP-47) of the output.

string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The targetLanguageCode to set.

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

setTargetLanguageCodeBytes(ByteString value)

public TranslateSpeechConfig.Builder setTargetLanguageCodeBytes(ByteString value)

Required. Target language code (BCP-47) of the output.

string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes for targetLanguageCode to set.

Returns
TypeDescription
TranslateSpeechConfig.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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