Class TranslateSpeechConfig

  • All Implemented Interfaces:
    TranslateSpeechConfigOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class TranslateSpeechConfig
    extends com.google.protobuf.GeneratedMessageV3
    implements TranslateSpeechConfigOrBuilder
     Provides information to the speech translation that specifies how to process
     the request.
     
    Protobuf type google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig
    See Also:
    Serialized Form
    • Field Detail

      • AUDIO_ENCODING_FIELD_NUMBER

        public static final int AUDIO_ENCODING_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SOURCE_LANGUAGE_CODE_FIELD_NUMBER

        public static final int SOURCE_LANGUAGE_CODE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • TARGET_LANGUAGE_CODE_FIELD_NUMBER

        public static final int TARGET_LANGUAGE_CODE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SAMPLE_RATE_HERTZ_FIELD_NUMBER

        public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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.
      • 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.
      • 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.
      • 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.
      • 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.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static TranslateSpeechConfig parseFrom​(ByteBuffer data)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static TranslateSpeechConfig parseFrom​(ByteBuffer data,
                                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static TranslateSpeechConfig parseFrom​(com.google.protobuf.ByteString data)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static TranslateSpeechConfig parseFrom​(com.google.protobuf.ByteString data,
                                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static TranslateSpeechConfig parseFrom​(byte[] data)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static TranslateSpeechConfig parseFrom​(byte[] data,
                                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • newBuilderForType

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

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

        protected TranslateSpeechConfig.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<TranslateSpeechConfig> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

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