Class TranslateSpeechConfig.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<TranslateSpeechConfig.Builder>
com.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig.Builder
All Implemented Interfaces:
TranslateSpeechConfigOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
TranslateSpeechConfig

public static final class TranslateSpeechConfig.Builder extends com.google.protobuf.GeneratedMessage.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
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<TranslateSpeechConfig.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<TranslateSpeechConfig.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<TranslateSpeechConfig.Builder>
    • getDefaultInstanceForType

      public TranslateSpeechConfig getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public TranslateSpeechConfig build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public TranslateSpeechConfig buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public TranslateSpeechConfig.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TranslateSpeechConfig.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<TranslateSpeechConfig.Builder>
    • mergeFrom

      public TranslateSpeechConfig.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TranslateSpeechConfig.Builder>
      Throws:
      IOException
    • 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](https://wikipedia.org/wiki/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];
      Specified by:
      getAudioEncoding in interface TranslateSpeechConfigOrBuilder
      Returns:
      The audioEncoding.
    • getAudioEncodingBytes

      public com.google.protobuf.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](https://wikipedia.org/wiki/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];
      Specified by:
      getAudioEncodingBytes in interface TranslateSpeechConfigOrBuilder
      Returns:
      The bytes for audioEncoding.
    • setAudioEncoding

      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](https://wikipedia.org/wiki/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];
      Parameters:
      value - The audioEncoding to set.
      Returns:
      This builder for chaining.
    • 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](https://wikipedia.org/wiki/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:
      This builder for chaining.
    • setAudioEncodingBytes

      public TranslateSpeechConfig.Builder setAudioEncodingBytes(com.google.protobuf.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](https://wikipedia.org/wiki/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];
      Parameters:
      value - The bytes for audioEncoding to set.
      Returns:
      This builder for chaining.
    • getSourceLanguageCode

      public String getSourceLanguageCode()
       Required. Source language code (BCP-47) of the input audio.
       
      string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSourceLanguageCode in interface TranslateSpeechConfigOrBuilder
      Returns:
      The sourceLanguageCode.
    • getSourceLanguageCodeBytes

      public com.google.protobuf.ByteString getSourceLanguageCodeBytes()
       Required. Source language code (BCP-47) of the input audio.
       
      string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSourceLanguageCodeBytes in interface TranslateSpeechConfigOrBuilder
      Returns:
      The bytes for sourceLanguageCode.
    • setSourceLanguageCode

      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];
      Parameters:
      value - The sourceLanguageCode to set.
      Returns:
      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:
      This builder for chaining.
    • setSourceLanguageCodeBytes

      public TranslateSpeechConfig.Builder setSourceLanguageCodeBytes(com.google.protobuf.ByteString value)
       Required. Source language code (BCP-47) of the input audio.
       
      string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for sourceLanguageCode to set.
      Returns:
      This builder for chaining.
    • getTargetLanguageCode

      public String getTargetLanguageCode()
       Required. Target language code (BCP-47) of the output.
       
      string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getTargetLanguageCode in interface TranslateSpeechConfigOrBuilder
      Returns:
      The targetLanguageCode.
    • getTargetLanguageCodeBytes

      public com.google.protobuf.ByteString getTargetLanguageCodeBytes()
       Required. Target language code (BCP-47) of the output.
       
      string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getTargetLanguageCodeBytes in interface TranslateSpeechConfigOrBuilder
      Returns:
      The bytes for targetLanguageCode.
    • setTargetLanguageCode

      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];
      Parameters:
      value - The targetLanguageCode to set.
      Returns:
      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:
      This builder for chaining.
    • setTargetLanguageCodeBytes

      public TranslateSpeechConfig.Builder setTargetLanguageCodeBytes(com.google.protobuf.ByteString value)
       Required. Target language code (BCP-47) of the output.
       
      string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for targetLanguageCode to set.
      Returns:
      This builder for chaining.
    • 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];
      Specified by:
      getSampleRateHertz in interface TranslateSpeechConfigOrBuilder
      Returns:
      The sampleRateHertz.
    • setSampleRateHertz

      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];
      Parameters:
      value - The sampleRateHertz to set.
      Returns:
      This builder for chaining.
    • 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:
      This builder for chaining.
    • 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];
      Specified by:
      getModel in interface TranslateSpeechConfigOrBuilder
      Returns:
      The model.
    • getModelBytes

      public com.google.protobuf.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];
      Specified by:
      getModelBytes in interface TranslateSpeechConfigOrBuilder
      Returns:
      The bytes for model.
    • setModel

      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];
      Parameters:
      value - The model to set.
      Returns:
      This builder for chaining.
    • 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:
      This builder for chaining.
    • setModelBytes

      public TranslateSpeechConfig.Builder setModelBytes(com.google.protobuf.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];
      Parameters:
      value - The bytes for model to set.
      Returns:
      This builder for chaining.