Class RecognitionConfig.Builder

  • All Implemented Interfaces:
    RecognitionConfigOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    RecognitionConfig

    public static final class RecognitionConfig.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<RecognitionConfig.Builder>
    implements RecognitionConfigOrBuilder
     Provides information to the recognizer that specifies how to process the
     request.
     
    Protobuf type google.cloud.speech.v1beta1.RecognitionConfig
    • Method Detail

      • 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.Builder<RecognitionConfig.Builder>
      • clear

        public RecognitionConfig.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.GeneratedMessageV3.Builder<RecognitionConfig.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.GeneratedMessageV3.Builder<RecognitionConfig.Builder>
      • getDefaultInstanceForType

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

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

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

        public RecognitionConfig.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionConfig.Builder>
      • setField

        public RecognitionConfig.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                  Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionConfig.Builder>
      • clearField

        public RecognitionConfig.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionConfig.Builder>
      • clearOneof

        public RecognitionConfig.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionConfig.Builder>
      • setRepeatedField

        public RecognitionConfig.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                          int index,
                                                          Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionConfig.Builder>
      • addRepeatedField

        public RecognitionConfig.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                          Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionConfig.Builder>
      • mergeFrom

        public RecognitionConfig.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<RecognitionConfig.Builder>
      • isInitialized

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

        public RecognitionConfig.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<RecognitionConfig.Builder>
        Throws:
        IOException
      • getEncodingValue

        public int getEncodingValue()
         *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
         
        .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
        Specified by:
        getEncodingValue in interface RecognitionConfigOrBuilder
      • setEncodingValue

        public RecognitionConfig.Builder setEncodingValue​(int value)
         *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
         
        .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
      • clearEncoding

        public RecognitionConfig.Builder clearEncoding()
         *Required* Encoding of audio data sent in all `RecognitionAudio` messages.
         
        .google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
      • getSampleRate

        public int getSampleRate()
         *Required* Sample rate in Hertz of the audio data sent in all
         `RecognitionAudio` messages. 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 = 2;
        Specified by:
        getSampleRate in interface RecognitionConfigOrBuilder
      • setSampleRate

        public RecognitionConfig.Builder setSampleRate​(int value)
         *Required* Sample rate in Hertz of the audio data sent in all
         `RecognitionAudio` messages. 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 = 2;
      • clearSampleRate

        public RecognitionConfig.Builder clearSampleRate()
         *Required* Sample rate in Hertz of the audio data sent in all
         `RecognitionAudio` messages. 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 = 2;
      • getLanguageCode

        public String getLanguageCode()
         *Optional* The language of the supplied audio as a BCP-47 language tag.
         Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
         If omitted, defaults to "en-US". See
         [Language Support](https://cloud.google.com/speech/docs/languages)
         for a list of the currently supported language codes.
         
        string language_code = 3;
        Specified by:
        getLanguageCode in interface RecognitionConfigOrBuilder
      • getLanguageCodeBytes

        public com.google.protobuf.ByteString getLanguageCodeBytes()
         *Optional* The language of the supplied audio as a BCP-47 language tag.
         Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
         If omitted, defaults to "en-US". See
         [Language Support](https://cloud.google.com/speech/docs/languages)
         for a list of the currently supported language codes.
         
        string language_code = 3;
        Specified by:
        getLanguageCodeBytes in interface RecognitionConfigOrBuilder
      • setLanguageCode

        public RecognitionConfig.Builder setLanguageCode​(String value)
         *Optional* The language of the supplied audio as a BCP-47 language tag.
         Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
         If omitted, defaults to "en-US". See
         [Language Support](https://cloud.google.com/speech/docs/languages)
         for a list of the currently supported language codes.
         
        string language_code = 3;
      • clearLanguageCode

        public RecognitionConfig.Builder clearLanguageCode()
         *Optional* The language of the supplied audio as a BCP-47 language tag.
         Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
         If omitted, defaults to "en-US". See
         [Language Support](https://cloud.google.com/speech/docs/languages)
         for a list of the currently supported language codes.
         
        string language_code = 3;
      • setLanguageCodeBytes

        public RecognitionConfig.Builder setLanguageCodeBytes​(com.google.protobuf.ByteString value)
         *Optional* The language of the supplied audio as a BCP-47 language tag.
         Example: "en-GB"  https://www.rfc-editor.org/rfc/bcp/bcp47.txt
         If omitted, defaults to "en-US". See
         [Language Support](https://cloud.google.com/speech/docs/languages)
         for a list of the currently supported language codes.
         
        string language_code = 3;
      • getMaxAlternatives

        public int getMaxAlternatives()
         *Optional* Maximum number of recognition hypotheses to be returned.
         Specifically, the maximum number of `SpeechRecognitionAlternative` messages
         within each `SpeechRecognitionResult`.
         The server may return fewer than `max_alternatives`.
         Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
         one. If omitted, will return a maximum of one.
         
        int32 max_alternatives = 4;
        Specified by:
        getMaxAlternatives in interface RecognitionConfigOrBuilder
      • setMaxAlternatives

        public RecognitionConfig.Builder setMaxAlternatives​(int value)
         *Optional* Maximum number of recognition hypotheses to be returned.
         Specifically, the maximum number of `SpeechRecognitionAlternative` messages
         within each `SpeechRecognitionResult`.
         The server may return fewer than `max_alternatives`.
         Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
         one. If omitted, will return a maximum of one.
         
        int32 max_alternatives = 4;
      • clearMaxAlternatives

        public RecognitionConfig.Builder clearMaxAlternatives()
         *Optional* Maximum number of recognition hypotheses to be returned.
         Specifically, the maximum number of `SpeechRecognitionAlternative` messages
         within each `SpeechRecognitionResult`.
         The server may return fewer than `max_alternatives`.
         Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
         one. If omitted, will return a maximum of one.
         
        int32 max_alternatives = 4;
      • getProfanityFilter

        public boolean getProfanityFilter()
         *Optional* If set to `true`, the server will attempt to filter out
         profanities, replacing all but the initial character in each filtered word
         with asterisks, e.g. "f***". If set to `false` or omitted, profanities
         won't be filtered out.
         
        bool profanity_filter = 5;
        Specified by:
        getProfanityFilter in interface RecognitionConfigOrBuilder
      • setProfanityFilter

        public RecognitionConfig.Builder setProfanityFilter​(boolean value)
         *Optional* If set to `true`, the server will attempt to filter out
         profanities, replacing all but the initial character in each filtered word
         with asterisks, e.g. "f***". If set to `false` or omitted, profanities
         won't be filtered out.
         
        bool profanity_filter = 5;
      • clearProfanityFilter

        public RecognitionConfig.Builder clearProfanityFilter()
         *Optional* If set to `true`, the server will attempt to filter out
         profanities, replacing all but the initial character in each filtered word
         with asterisks, e.g. "f***". If set to `false` or omitted, profanities
         won't be filtered out.
         
        bool profanity_filter = 5;
      • hasSpeechContext

        public boolean hasSpeechContext()
         *Optional* A means to provide context to assist the speech recognition.
         
        .google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
        Specified by:
        hasSpeechContext in interface RecognitionConfigOrBuilder
      • setSpeechContext

        public RecognitionConfig.Builder setSpeechContext​(SpeechContext value)
         *Optional* A means to provide context to assist the speech recognition.
         
        .google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
      • setSpeechContext

        public RecognitionConfig.Builder setSpeechContext​(SpeechContext.Builder builderForValue)
         *Optional* A means to provide context to assist the speech recognition.
         
        .google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
      • mergeSpeechContext

        public RecognitionConfig.Builder mergeSpeechContext​(SpeechContext value)
         *Optional* A means to provide context to assist the speech recognition.
         
        .google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
      • clearSpeechContext

        public RecognitionConfig.Builder clearSpeechContext()
         *Optional* A means to provide context to assist the speech recognition.
         
        .google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
      • getSpeechContextBuilder

        public SpeechContext.Builder getSpeechContextBuilder()
         *Optional* A means to provide context to assist the speech recognition.
         
        .google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
      • setUnknownFields

        public final RecognitionConfig.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionConfig.Builder>
      • mergeUnknownFields

        public final RecognitionConfig.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<RecognitionConfig.Builder>