Send feedback
Class RecognitionConfig (4.31.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 4.31.0 keyboard_arrow_down
public final class RecognitionConfig extends GeneratedMessageV3 implements RecognitionConfigOrBuilder
Provides information to the recognizer that specifies how to process the
request.
Protobuf type google.cloud.speech.v1beta1.RecognitionConfig
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
ENCODING_FIELD_NUMBER
public static final int ENCODING_FIELD_NUMBER
Field Value Type Description int
LANGUAGE_CODE_FIELD_NUMBER
public static final int LANGUAGE_CODE_FIELD_NUMBER
Field Value Type Description int
MAX_ALTERNATIVES_FIELD_NUMBER
public static final int MAX_ALTERNATIVES_FIELD_NUMBER
Field Value Type Description int
PROFANITY_FILTER_FIELD_NUMBER
public static final int PROFANITY_FILTER_FIELD_NUMBER
Field Value Type Description int
SAMPLE_RATE_FIELD_NUMBER
public static final int SAMPLE_RATE_FIELD_NUMBER
Field Value Type Description int
SPEECH_CONTEXT_FIELD_NUMBER
public static final int SPEECH_CONTEXT_FIELD_NUMBER
Field Value Type Description int
Static Methods
getDefaultInstance()
public static RecognitionConfig getDefaultInstance ()
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
newBuilder()
public static RecognitionConfig . Builder newBuilder ()
newBuilder(RecognitionConfig prototype)
public static RecognitionConfig . Builder newBuilder ( RecognitionConfig prototype )
public static RecognitionConfig parseDelimitedFrom ( InputStream input )
public static RecognitionConfig parseDelimitedFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
parseFrom(byte[] data)
public static RecognitionConfig parseFrom ( byte [] data )
Parameter Name Description data
byte []
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static RecognitionConfig parseFrom ( byte [] data , ExtensionRegistryLite extensionRegistry )
parseFrom(ByteString data)
public static RecognitionConfig parseFrom ( ByteString data )
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static RecognitionConfig parseFrom ( ByteString data , ExtensionRegistryLite extensionRegistry )
public static RecognitionConfig parseFrom ( CodedInputStream input )
public static RecognitionConfig parseFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
public static RecognitionConfig parseFrom ( InputStream input )
public static RecognitionConfig parseFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
parseFrom(ByteBuffer data)
public static RecognitionConfig parseFrom ( ByteBuffer data )
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static RecognitionConfig parseFrom ( ByteBuffer data , ExtensionRegistryLite extensionRegistry )
parser()
public static Parser<RecognitionConfig> parser ()
Methods
equals(Object obj)
public boolean equals ( Object obj )
Parameter Name Description obj
Object
Overrides
getDefaultInstanceForType()
public RecognitionConfig getDefaultInstanceForType ()
getEncoding()
public RecognitionConfig . AudioEncoding getEncoding ()
Required Encoding of audio data sent in all RecognitionAudio
messages.
.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
getEncodingValue()
public int getEncodingValue ()
Required Encoding of audio data sent in all RecognitionAudio
messages.
.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
Returns Type Description int
getLanguageCode()
public String getLanguageCode ()
getLanguageCodeBytes()
public ByteString getLanguageCodeBytes ()
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;
Returns Type Description int
getParserForType()
public Parser<RecognitionConfig> getParserForType ()
Overrides
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;
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;
Returns Type Description int
getSerializedSize()
public int getSerializedSize ()
Returns Type Description int
Overrides
getSpeechContext()
public SpeechContext getSpeechContext ()
Optional A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
getSpeechContextOrBuilder()
public SpeechContextOrBuilder getSpeechContextOrBuilder ()
Optional A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
getUnknownFields()
public final UnknownFieldSet getUnknownFields ()
Overrides
hasSpeechContext()
public boolean hasSpeechContext ()
Optional A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
hashCode()
Returns Type Description int
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Overrides
isInitialized()
public final boolean isInitialized ()
Overrides
newBuilderForType()
public RecognitionConfig . Builder newBuilderForType ()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected RecognitionConfig . Builder newBuilderForType ( GeneratedMessageV3 . BuilderParent parent )
Overrides
toBuilder()
public RecognitionConfig . Builder toBuilder ()
writeTo(CodedOutputStream output)
public void writeTo ( CodedOutputStream output )
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-28 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-28 UTC."],[],[]]