public static final class RecognitionFeatures.Builder extends com.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder> implements RecognitionFeaturesOrBuilder
Available recognition features.Protobuf type
google.cloud.speech.v2.RecognitionFeatures| Modifier and Type | Method and Description |
|---|---|
RecognitionFeatures |
build() |
RecognitionFeatures |
buildPartial() |
RecognitionFeatures.Builder |
clear() |
RecognitionFeatures.Builder |
clearCustomPromptConfig()
Optional.
|
RecognitionFeatures.Builder |
clearDiarizationConfig()
Configuration to enable speaker diarization.
|
RecognitionFeatures.Builder |
clearEnableAutomaticPunctuation()
If `true`, adds punctuation to recognition result hypotheses.
|
RecognitionFeatures.Builder |
clearEnableSpokenEmojis()
The spoken emoji behavior for the call.
|
RecognitionFeatures.Builder |
clearEnableSpokenPunctuation()
The spoken punctuation behavior for the call.
|
RecognitionFeatures.Builder |
clearEnableWordConfidence()
If `true`, the top result includes a list of words and the confidence for
those words.
|
RecognitionFeatures.Builder |
clearEnableWordTimeOffsets()
If `true`, the top result includes a list of words and the start and end
time offsets (timestamps) for those words.
|
RecognitionFeatures.Builder |
clearMaxAlternatives()
Maximum number of recognition hypotheses to be returned.
|
RecognitionFeatures.Builder |
clearMultiChannelMode()
Mode for recognizing multi-channel audio.
|
RecognitionFeatures.Builder |
clearProfanityFilter()
If set to `true`, the server will attempt to filter out profanities,
replacing all but the initial character in each filtered word with
asterisks, for instance, "f***".
|
CustomPromptConfig |
getCustomPromptConfig()
Optional.
|
CustomPromptConfig.Builder |
getCustomPromptConfigBuilder()
Optional.
|
CustomPromptConfigOrBuilder |
getCustomPromptConfigOrBuilder()
Optional.
|
RecognitionFeatures |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
SpeakerDiarizationConfig |
getDiarizationConfig()
Configuration to enable speaker diarization.
|
SpeakerDiarizationConfig.Builder |
getDiarizationConfigBuilder()
Configuration to enable speaker diarization.
|
SpeakerDiarizationConfigOrBuilder |
getDiarizationConfigOrBuilder()
Configuration to enable speaker diarization.
|
boolean |
getEnableAutomaticPunctuation()
If `true`, adds punctuation to recognition result hypotheses.
|
boolean |
getEnableSpokenEmojis()
The spoken emoji behavior for the call.
|
boolean |
getEnableSpokenPunctuation()
The spoken punctuation behavior for the call.
|
boolean |
getEnableWordConfidence()
If `true`, the top result includes a list of words and the confidence for
those words.
|
boolean |
getEnableWordTimeOffsets()
If `true`, the top result includes a list of words and the start and end
time offsets (timestamps) for those words.
|
int |
getMaxAlternatives()
Maximum number of recognition hypotheses to be returned.
|
RecognitionFeatures.MultiChannelMode |
getMultiChannelMode()
Mode for recognizing multi-channel audio.
|
int |
getMultiChannelModeValue()
Mode for recognizing multi-channel audio.
|
boolean |
getProfanityFilter()
If set to `true`, the server will attempt to filter out profanities,
replacing all but the initial character in each filtered word with
asterisks, for instance, "f***".
|
boolean |
hasCustomPromptConfig()
Optional.
|
boolean |
hasDiarizationConfig()
Configuration to enable speaker diarization.
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
RecognitionFeatures.Builder |
mergeCustomPromptConfig(CustomPromptConfig value)
Optional.
|
RecognitionFeatures.Builder |
mergeDiarizationConfig(SpeakerDiarizationConfig value)
Configuration to enable speaker diarization.
|
RecognitionFeatures.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
RecognitionFeatures.Builder |
mergeFrom(com.google.protobuf.Message other) |
RecognitionFeatures.Builder |
mergeFrom(RecognitionFeatures other) |
RecognitionFeatures.Builder |
setCustomPromptConfig(CustomPromptConfig.Builder builderForValue)
Optional.
|
RecognitionFeatures.Builder |
setCustomPromptConfig(CustomPromptConfig value)
Optional.
|
RecognitionFeatures.Builder |
setDiarizationConfig(SpeakerDiarizationConfig.Builder builderForValue)
Configuration to enable speaker diarization.
|
RecognitionFeatures.Builder |
setDiarizationConfig(SpeakerDiarizationConfig value)
Configuration to enable speaker diarization.
|
RecognitionFeatures.Builder |
setEnableAutomaticPunctuation(boolean value)
If `true`, adds punctuation to recognition result hypotheses.
|
RecognitionFeatures.Builder |
setEnableSpokenEmojis(boolean value)
The spoken emoji behavior for the call.
|
RecognitionFeatures.Builder |
setEnableSpokenPunctuation(boolean value)
The spoken punctuation behavior for the call.
|
RecognitionFeatures.Builder |
setEnableWordConfidence(boolean value)
If `true`, the top result includes a list of words and the confidence for
those words.
|
RecognitionFeatures.Builder |
setEnableWordTimeOffsets(boolean value)
If `true`, the top result includes a list of words and the start and end
time offsets (timestamps) for those words.
|
RecognitionFeatures.Builder |
setMaxAlternatives(int value)
Maximum number of recognition hypotheses to be returned.
|
RecognitionFeatures.Builder |
setMultiChannelMode(RecognitionFeatures.MultiChannelMode value)
Mode for recognizing multi-channel audio.
|
RecognitionFeatures.Builder |
setMultiChannelModeValue(int value)
Mode for recognizing multi-channel audio.
|
RecognitionFeatures.Builder |
setProfanityFilter(boolean value)
If set to `true`, the server will attempt to filter out profanities,
replacing all but the initial character in each filtered word with
asterisks, for instance, "f***".
|
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>public RecognitionFeatures.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>public RecognitionFeatures getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic RecognitionFeatures build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic RecognitionFeatures buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic RecognitionFeatures.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<RecognitionFeatures.Builder>public RecognitionFeatures.Builder mergeFrom(RecognitionFeatures other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessage.Builder<RecognitionFeatures.Builder>public RecognitionFeatures.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<RecognitionFeatures.Builder>IOExceptionpublic boolean getProfanityFilter()
If set to `true`, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***". If set to `false` or omitted, profanities won't be filtered out.
bool profanity_filter = 1;getProfanityFilter in interface RecognitionFeaturesOrBuilderpublic RecognitionFeatures.Builder setProfanityFilter(boolean value)
If set to `true`, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***". If set to `false` or omitted, profanities won't be filtered out.
bool profanity_filter = 1;value - The profanityFilter to set.public RecognitionFeatures.Builder clearProfanityFilter()
If set to `true`, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***". If set to `false` or omitted, profanities won't be filtered out.
bool profanity_filter = 1;public boolean getEnableWordTimeOffsets()
If `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If `false`, no word-level time offset information is returned. The default is `false`.
bool enable_word_time_offsets = 2;getEnableWordTimeOffsets in interface RecognitionFeaturesOrBuilderpublic RecognitionFeatures.Builder setEnableWordTimeOffsets(boolean value)
If `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If `false`, no word-level time offset information is returned. The default is `false`.
bool enable_word_time_offsets = 2;value - The enableWordTimeOffsets to set.public RecognitionFeatures.Builder clearEnableWordTimeOffsets()
If `true`, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If `false`, no word-level time offset information is returned. The default is `false`.
bool enable_word_time_offsets = 2;public boolean getEnableWordConfidence()
If `true`, the top result includes a list of words and the confidence for those words. If `false`, no word-level confidence information is returned. The default is `false`.
bool enable_word_confidence = 3;getEnableWordConfidence in interface RecognitionFeaturesOrBuilderpublic RecognitionFeatures.Builder setEnableWordConfidence(boolean value)
If `true`, the top result includes a list of words and the confidence for those words. If `false`, no word-level confidence information is returned. The default is `false`.
bool enable_word_confidence = 3;value - The enableWordConfidence to set.public RecognitionFeatures.Builder clearEnableWordConfidence()
If `true`, the top result includes a list of words and the confidence for those words. If `false`, no word-level confidence information is returned. The default is `false`.
bool enable_word_confidence = 3;public boolean getEnableAutomaticPunctuation()
If `true`, adds punctuation to recognition result hypotheses. This feature is only available in select languages. The default `false` value does not add punctuation to result hypotheses.
bool enable_automatic_punctuation = 4;getEnableAutomaticPunctuation in interface RecognitionFeaturesOrBuilderpublic RecognitionFeatures.Builder setEnableAutomaticPunctuation(boolean value)
If `true`, adds punctuation to recognition result hypotheses. This feature is only available in select languages. The default `false` value does not add punctuation to result hypotheses.
bool enable_automatic_punctuation = 4;value - The enableAutomaticPunctuation to set.public RecognitionFeatures.Builder clearEnableAutomaticPunctuation()
If `true`, adds punctuation to recognition result hypotheses. This feature is only available in select languages. The default `false` value does not add punctuation to result hypotheses.
bool enable_automatic_punctuation = 4;public boolean getEnableSpokenPunctuation()
The spoken punctuation behavior for the call. If `true`, replaces spoken punctuation with the corresponding symbols in the request. For example, "how are you question mark" becomes "how are you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation for support. If `false`, spoken punctuation is not replaced.
bool enable_spoken_punctuation = 14;getEnableSpokenPunctuation in interface RecognitionFeaturesOrBuilderpublic RecognitionFeatures.Builder setEnableSpokenPunctuation(boolean value)
The spoken punctuation behavior for the call. If `true`, replaces spoken punctuation with the corresponding symbols in the request. For example, "how are you question mark" becomes "how are you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation for support. If `false`, spoken punctuation is not replaced.
bool enable_spoken_punctuation = 14;value - The enableSpokenPunctuation to set.public RecognitionFeatures.Builder clearEnableSpokenPunctuation()
The spoken punctuation behavior for the call. If `true`, replaces spoken punctuation with the corresponding symbols in the request. For example, "how are you question mark" becomes "how are you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation for support. If `false`, spoken punctuation is not replaced.
bool enable_spoken_punctuation = 14;public boolean getEnableSpokenEmojis()
The spoken emoji behavior for the call. If `true`, adds spoken emoji formatting for the request. This will replace spoken emojis with the corresponding Unicode symbols in the final transcript. If `false`, spoken emojis are not replaced.
bool enable_spoken_emojis = 15;getEnableSpokenEmojis in interface RecognitionFeaturesOrBuilderpublic RecognitionFeatures.Builder setEnableSpokenEmojis(boolean value)
The spoken emoji behavior for the call. If `true`, adds spoken emoji formatting for the request. This will replace spoken emojis with the corresponding Unicode symbols in the final transcript. If `false`, spoken emojis are not replaced.
bool enable_spoken_emojis = 15;value - The enableSpokenEmojis to set.public RecognitionFeatures.Builder clearEnableSpokenEmojis()
The spoken emoji behavior for the call. If `true`, adds spoken emoji formatting for the request. This will replace spoken emojis with the corresponding Unicode symbols in the final transcript. If `false`, spoken emojis are not replaced.
bool enable_spoken_emojis = 15;public int getMultiChannelModeValue()
Mode for recognizing multi-channel audio.
.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;
getMultiChannelModeValue in interface RecognitionFeaturesOrBuilderpublic RecognitionFeatures.Builder setMultiChannelModeValue(int value)
Mode for recognizing multi-channel audio.
.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;
value - The enum numeric value on the wire for multiChannelMode to set.public RecognitionFeatures.MultiChannelMode getMultiChannelMode()
Mode for recognizing multi-channel audio.
.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;
getMultiChannelMode in interface RecognitionFeaturesOrBuilderpublic RecognitionFeatures.Builder setMultiChannelMode(RecognitionFeatures.MultiChannelMode value)
Mode for recognizing multi-channel audio.
.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;
value - The multiChannelMode to set.public RecognitionFeatures.Builder clearMultiChannelMode()
Mode for recognizing multi-channel audio.
.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;
public boolean hasDiarizationConfig()
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;hasDiarizationConfig in interface RecognitionFeaturesOrBuilderpublic SpeakerDiarizationConfig getDiarizationConfig()
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;getDiarizationConfig in interface RecognitionFeaturesOrBuilderpublic RecognitionFeatures.Builder setDiarizationConfig(SpeakerDiarizationConfig value)
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;public RecognitionFeatures.Builder setDiarizationConfig(SpeakerDiarizationConfig.Builder builderForValue)
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;public RecognitionFeatures.Builder mergeDiarizationConfig(SpeakerDiarizationConfig value)
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;public RecognitionFeatures.Builder clearDiarizationConfig()
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;public SpeakerDiarizationConfig.Builder getDiarizationConfigBuilder()
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;public SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder()
Configuration to enable speaker diarization. To enable diarization, set this field to an empty SpeakerDiarizationConfig message.
.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;getDiarizationConfigOrBuilder in interface RecognitionFeaturesOrBuilderpublic int getMaxAlternatives()
Maximum number of recognition hypotheses to be returned. 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 = 16;getMaxAlternatives in interface RecognitionFeaturesOrBuilderpublic RecognitionFeatures.Builder setMaxAlternatives(int value)
Maximum number of recognition hypotheses to be returned. 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 = 16;value - The maxAlternatives to set.public RecognitionFeatures.Builder clearMaxAlternatives()
Maximum number of recognition hypotheses to be returned. 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 = 16;public boolean hasCustomPromptConfig()
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];
hasCustomPromptConfig in interface RecognitionFeaturesOrBuilderpublic CustomPromptConfig getCustomPromptConfig()
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];
getCustomPromptConfig in interface RecognitionFeaturesOrBuilderpublic RecognitionFeatures.Builder setCustomPromptConfig(CustomPromptConfig value)
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];
public RecognitionFeatures.Builder setCustomPromptConfig(CustomPromptConfig.Builder builderForValue)
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];
public RecognitionFeatures.Builder mergeCustomPromptConfig(CustomPromptConfig value)
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];
public RecognitionFeatures.Builder clearCustomPromptConfig()
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];
public CustomPromptConfig.Builder getCustomPromptConfigBuilder()
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];
public CustomPromptConfigOrBuilder getCustomPromptConfigOrBuilder()
Optional. Configuration to enable custom prompt for chirp3.
.google.cloud.speech.v2.CustomPromptConfig custom_prompt_config = 18 [(.google.api.field_behavior) = OPTIONAL];
getCustomPromptConfigOrBuilder in interface RecognitionFeaturesOrBuilderCopyright © 2026 Google LLC. All rights reserved.