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
Static Fields
ENCODING_FIELD_NUMBER
public static final int ENCODING_FIELD_NUMBER
Field Value
LANGUAGE_CODE_FIELD_NUMBER
public static final int LANGUAGE_CODE_FIELD_NUMBER
Field Value
MAX_ALTERNATIVES_FIELD_NUMBER
public static final int MAX_ALTERNATIVES_FIELD_NUMBER
Field Value
PROFANITY_FILTER_FIELD_NUMBER
public static final int PROFANITY_FILTER_FIELD_NUMBER
Field Value
SAMPLE_RATE_FIELD_NUMBER
public static final int SAMPLE_RATE_FIELD_NUMBER
Field Value
SPEECH_CONTEXT_FIELD_NUMBER
public static final int SPEECH_CONTEXT_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static RecognitionConfig getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static RecognitionConfig.Builder newBuilder()
Returns
newBuilder(RecognitionConfig prototype)
public static RecognitionConfig.Builder newBuilder(RecognitionConfig prototype)
Parameter
Returns
public static RecognitionConfig parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static RecognitionConfig parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static RecognitionConfig parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static RecognitionConfig parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static RecognitionConfig parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static RecognitionConfig parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static RecognitionConfig parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static RecognitionConfig parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static RecognitionConfig parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static RecognitionConfig parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static RecognitionConfig parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static RecognitionConfig parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<RecognitionConfig> parser()
Returns
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getDefaultInstanceForType()
public RecognitionConfig getDefaultInstanceForType()
Returns
getEncoding()
public RecognitionConfig.AudioEncoding getEncoding()
Required Encoding of audio data sent in all RecognitionAudio
messages.
.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
Returns
getEncodingValue()
public int getEncodingValue()
Required Encoding of audio data sent in all RecognitionAudio
messages.
.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
Returns
getLanguageCode()
public String getLanguageCode()
Returns
getLanguageCodeBytes()
public ByteString getLanguageCodeBytes()
Returns
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
getParserForType()
public Parser<RecognitionConfig> getParserForType()
Returns
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;
Returns
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
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
getSpeechContext()
public SpeechContext getSpeechContext()
Optional A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
Returns
getSpeechContextOrBuilder()
public SpeechContextOrBuilder getSpeechContextOrBuilder()
Optional A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
Returns
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
hasSpeechContext()
public boolean hasSpeechContext()
Optional A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
Returns
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public RecognitionConfig.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected RecognitionConfig.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
toBuilder()
public RecognitionConfig.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions