Class RecognitionConfig

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

    public final class RecognitionConfig
    extends com.google.protobuf.GeneratedMessageV3
    implements RecognitionConfigOrBuilder
     Provides information to the Recognizer that specifies how to process the
     recognition request.
     
    Protobuf type google.cloud.speech.v2.RecognitionConfig
    See Also:
    Serialized Form
    • Field Detail

      • AUTO_DECODING_CONFIG_FIELD_NUMBER

        public static final int AUTO_DECODING_CONFIG_FIELD_NUMBER
        See Also:
        Constant Field Values
      • EXPLICIT_DECODING_CONFIG_FIELD_NUMBER

        public static final int EXPLICIT_DECODING_CONFIG_FIELD_NUMBER
        See Also:
        Constant Field Values
      • LANGUAGE_CODES_FIELD_NUMBER

        public static final int LANGUAGE_CODES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ADAPTATION_FIELD_NUMBER

        public static final int ADAPTATION_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
      • hasAutoDecodingConfig

        public boolean hasAutoDecodingConfig()
         Automatically detect decoding parameters.
         Preferred for supported formats.
         
        .google.cloud.speech.v2.AutoDetectDecodingConfig auto_decoding_config = 7;
        Specified by:
        hasAutoDecodingConfig in interface RecognitionConfigOrBuilder
        Returns:
        Whether the autoDecodingConfig field is set.
      • hasExplicitDecodingConfig

        public boolean hasExplicitDecodingConfig()
         Explicitly specified decoding parameters.
         Required if using headerless PCM audio (linear16, mulaw, alaw).
         
        .google.cloud.speech.v2.ExplicitDecodingConfig explicit_decoding_config = 8;
        Specified by:
        hasExplicitDecodingConfig in interface RecognitionConfigOrBuilder
        Returns:
        Whether the explicitDecodingConfig field is set.
      • getExplicitDecodingConfig

        public ExplicitDecodingConfig getExplicitDecodingConfig()
         Explicitly specified decoding parameters.
         Required if using headerless PCM audio (linear16, mulaw, alaw).
         
        .google.cloud.speech.v2.ExplicitDecodingConfig explicit_decoding_config = 8;
        Specified by:
        getExplicitDecodingConfig in interface RecognitionConfigOrBuilder
        Returns:
        The explicitDecodingConfig.
      • getModel

        public String getModel()
         Optional. Which model to use for recognition requests. Select the model
         best suited to your domain to get best results.
        
         Guidance for choosing which model to use can be found in the [Transcription
         Models
         Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model)
         and the models supported in each region can be found in the [Table Of
         Supported
         Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).
         
        string model = 9 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getModel in interface RecognitionConfigOrBuilder
        Returns:
        The model.
      • getModelBytes

        public com.google.protobuf.ByteString getModelBytes()
         Optional. Which model to use for recognition requests. Select the model
         best suited to your domain to get best results.
        
         Guidance for choosing which model to use can be found in the [Transcription
         Models
         Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model)
         and the models supported in each region can be found in the [Table Of
         Supported
         Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).
         
        string model = 9 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getModelBytes in interface RecognitionConfigOrBuilder
        Returns:
        The bytes for model.
      • getLanguageCodesList

        public com.google.protobuf.ProtocolStringList getLanguageCodesList()
         Optional. The language of the supplied audio as a
         [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
         Language tags are normalized to BCP-47 before they are used eg "en-us"
         becomes "en-US".
        
         Supported languages for each model are listed in the [Table of Supported
         Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).
        
         If additional languages are provided, recognition result will contain
         recognition in the most likely language detected. The recognition result
         will include the language tag of the language detected in the audio.
         
        repeated string language_codes = 10 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getLanguageCodesList in interface RecognitionConfigOrBuilder
        Returns:
        A list containing the languageCodes.
      • getLanguageCodesCount

        public int getLanguageCodesCount()
         Optional. The language of the supplied audio as a
         [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
         Language tags are normalized to BCP-47 before they are used eg "en-us"
         becomes "en-US".
        
         Supported languages for each model are listed in the [Table of Supported
         Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).
        
         If additional languages are provided, recognition result will contain
         recognition in the most likely language detected. The recognition result
         will include the language tag of the language detected in the audio.
         
        repeated string language_codes = 10 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getLanguageCodesCount in interface RecognitionConfigOrBuilder
        Returns:
        The count of languageCodes.
      • getLanguageCodes

        public String getLanguageCodes​(int index)
         Optional. The language of the supplied audio as a
         [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
         Language tags are normalized to BCP-47 before they are used eg "en-us"
         becomes "en-US".
        
         Supported languages for each model are listed in the [Table of Supported
         Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).
        
         If additional languages are provided, recognition result will contain
         recognition in the most likely language detected. The recognition result
         will include the language tag of the language detected in the audio.
         
        repeated string language_codes = 10 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getLanguageCodes in interface RecognitionConfigOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The languageCodes at the given index.
      • getLanguageCodesBytes

        public com.google.protobuf.ByteString getLanguageCodesBytes​(int index)
         Optional. The language of the supplied audio as a
         [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
         Language tags are normalized to BCP-47 before they are used eg "en-us"
         becomes "en-US".
        
         Supported languages for each model are listed in the [Table of Supported
         Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).
        
         If additional languages are provided, recognition result will contain
         recognition in the most likely language detected. The recognition result
         will include the language tag of the language detected in the audio.
         
        repeated string language_codes = 10 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getLanguageCodesBytes in interface RecognitionConfigOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the languageCodes at the given index.
      • hasFeatures

        public boolean hasFeatures()
         Speech recognition features to enable.
         
        .google.cloud.speech.v2.RecognitionFeatures features = 2;
        Specified by:
        hasFeatures in interface RecognitionConfigOrBuilder
        Returns:
        Whether the features field is set.
      • hasAdaptation

        public boolean hasAdaptation()
         Speech adaptation context that weights recognizer predictions for specific
         words and phrases.
         
        .google.cloud.speech.v2.SpeechAdaptation adaptation = 6;
        Specified by:
        hasAdaptation in interface RecognitionConfigOrBuilder
        Returns:
        Whether the adaptation field is set.
      • getAdaptation

        public SpeechAdaptation getAdaptation()
         Speech adaptation context that weights recognizer predictions for specific
         words and phrases.
         
        .google.cloud.speech.v2.SpeechAdaptation adaptation = 6;
        Specified by:
        getAdaptation in interface RecognitionConfigOrBuilder
        Returns:
        The adaptation.
      • 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 RecognitionConfig parseFrom​(ByteBuffer data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

        public static RecognitionConfig parseFrom​(com.google.protobuf.CodedInputStream input,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws IOException
        Throws:
        IOException
      • newBuilderForType

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

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

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

        public com.google.protobuf.Parser<RecognitionConfig> 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 RecognitionConfig getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder