public static final class RecognitionConfig.Builder extends 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
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public RecognitionConfig.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
build()
public RecognitionConfig build()
Returns
buildPartial()
public RecognitionConfig buildPartial()
Returns
clear()
public RecognitionConfig.Builder clear()
Returns
Overrides
clearEncoding()
public RecognitionConfig.Builder clearEncoding()
Required Encoding of audio data sent in all RecognitionAudio
messages.
.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
Returns
clearField(Descriptors.FieldDescriptor field)
public RecognitionConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearLanguageCode()
public RecognitionConfig.Builder clearLanguageCode()
Returns
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;
Returns
clearOneof(Descriptors.OneofDescriptor oneof)
public RecognitionConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
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;
Returns
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;
Returns
clearSpeechContext()
public RecognitionConfig.Builder clearSpeechContext()
Optional A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
Returns
clone()
public RecognitionConfig.Builder clone()
Returns
Overrides
getDefaultInstanceForType()
public RecognitionConfig getDefaultInstanceForType()
Returns
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
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
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
getSpeechContext()
public SpeechContext getSpeechContext()
Optional A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
Returns
getSpeechContextBuilder()
public SpeechContext.Builder getSpeechContextBuilder()
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
hasSpeechContext()
public boolean hasSpeechContext()
Optional A means to provide context to assist the speech recognition.
.google.cloud.speech.v1beta1.SpeechContext speech_context = 6;
Returns
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
mergeFrom(RecognitionConfig other)
public RecognitionConfig.Builder mergeFrom(RecognitionConfig other)
Parameter
Returns
public RecognitionConfig.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public RecognitionConfig.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeSpeechContext(SpeechContext value)
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;
Parameter
Returns
mergeUnknownFields(UnknownFieldSet unknownFields)
public final RecognitionConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides
setEncoding(RecognitionConfig.AudioEncoding value)
public RecognitionConfig.Builder setEncoding(RecognitionConfig.AudioEncoding value)
Required Encoding of audio data sent in all RecognitionAudio
messages.
.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
Parameter
Returns
setEncodingValue(int value)
public RecognitionConfig.Builder setEncodingValue(int value)
Required Encoding of audio data sent in all RecognitionAudio
messages.
.google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding encoding = 1;
Parameter
Returns
setField(Descriptors.FieldDescriptor field, Object value)
public RecognitionConfig.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
setLanguageCode(String value)
public RecognitionConfig.Builder setLanguageCode(String value)
Parameter
Returns
setLanguageCodeBytes(ByteString value)
public RecognitionConfig.Builder setLanguageCodeBytes(ByteString value)
Parameter
Returns
setMaxAlternatives(int value)
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;
Parameter
Returns
setProfanityFilter(boolean value)
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;
Parameter
Returns
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public RecognitionConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
Overrides
setSampleRate(int value)
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;
Parameter
Returns
setSpeechContext(SpeechContext value)
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;
Parameter
Returns
setSpeechContext(SpeechContext.Builder builderForValue)
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;
Parameter
Returns
setUnknownFields(UnknownFieldSet unknownFields)
public final RecognitionConfig.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides