Package com.google.cloud.speech.v1
Class StreamingRecognitionConfig.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<StreamingRecognitionConfig.Builder>
com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder
- All Implemented Interfaces:
StreamingRecognitionConfigOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- StreamingRecognitionConfig
public static final class StreamingRecognitionConfig.Builder
extends com.google.protobuf.GeneratedMessage.Builder<StreamingRecognitionConfig.Builder>
implements StreamingRecognitionConfigOrBuilder
Provides information to the recognizer that specifies how to process the request.Protobuf type
google.cloud.speech.v1.StreamingRecognitionConfig-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()Required.If `true`, responses with voice activity speech events will be returned as they are detected.If `true`, interim results (tentative hypotheses) may be returned as they become available (these interim results are indicated with the `is_final=false` flag).If `false` or omitted, the recognizer will perform continuous recognition (continuing to wait for and process audio even if the user pauses speaking) until the client closes the input stream (gRPC API) or until the maximum time limit has been reached.If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent.Required.Required.Required.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorbooleanIf `true`, responses with voice activity speech events will be returned as they are detected.booleanIf `true`, interim results (tentative hypotheses) may be returned as they become available (these interim results are indicated with the `is_final=false` flag).booleanIf `false` or omitted, the recognizer will perform continuous recognition (continuing to wait for and process audio even if the user pauses speaking) until the client closes the input stream (gRPC API) or until the maximum time limit has been reached.If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent.If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent.If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent.booleanRequired.booleanIf set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeConfig(RecognitionConfig value) Required.mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent.setConfig(RecognitionConfig value) Required.setConfig(RecognitionConfig.Builder builderForValue) Required.setEnableVoiceActivityEvents(boolean value) If `true`, responses with voice activity speech events will be returned as they are detected.setInterimResults(boolean value) If `true`, interim results (tentative hypotheses) may be returned as they become available (these interim results are indicated with the `is_final=false` flag).setSingleUtterance(boolean value) If `false` or omitted, the recognizer will perform continuous recognition (continuing to wait for and process audio even if the user pauses speaking) until the client closes the input stream (gRPC API) or until the maximum time limit has been reached.If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent.If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
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, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<StreamingRecognitionConfig.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<StreamingRecognitionConfig.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<StreamingRecognitionConfig.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<StreamingRecognitionConfig.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<StreamingRecognitionConfig.Builder>
-
mergeFrom
public StreamingRecognitionConfig.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<StreamingRecognitionConfig.Builder>- Throws:
IOException
-
hasConfig
public boolean hasConfig()Required. Provides information to the recognizer that specifies how to process the request.
.google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
hasConfigin interfaceStreamingRecognitionConfigOrBuilder- Returns:
- Whether the config field is set.
-
getConfig
Required. Provides information to the recognizer that specifies how to process the request.
.google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getConfigin interfaceStreamingRecognitionConfigOrBuilder- Returns:
- The config.
-
setConfig
Required. Provides information to the recognizer that specifies how to process the request.
.google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; -
setConfig
Required. Provides information to the recognizer that specifies how to process the request.
.google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; -
mergeConfig
Required. Provides information to the recognizer that specifies how to process the request.
.google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; -
clearConfig
Required. Provides information to the recognizer that specifies how to process the request.
.google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; -
getConfigBuilder
Required. Provides information to the recognizer that specifies how to process the request.
.google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; -
getConfigOrBuilder
Required. Provides information to the recognizer that specifies how to process the request.
.google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getConfigOrBuilderin interfaceStreamingRecognitionConfigOrBuilder
-
getSingleUtterance
public boolean getSingleUtterance()If `false` or omitted, the recognizer will perform continuous recognition (continuing to wait for and process audio even if the user pauses speaking) until the client closes the input stream (gRPC API) or until the maximum time limit has been reached. May return multiple `StreamingRecognitionResult`s with the `is_final` flag set to `true`. If `true`, the recognizer will detect a single spoken utterance. When it detects that the user has paused or stopped speaking, it will return an `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no more than one `StreamingRecognitionResult` with the `is_final` flag set to `true`. The `single_utterance` field can only be used with specified models, otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] must be set to: * `command_and_search` * `phone_call` AND additional field `useEnhanced`=`true` * The `model` field is left undefined. In this case the API auto-selects a model based on any other parameters that you set in `RecognitionConfig`.
bool single_utterance = 2;- Specified by:
getSingleUtterancein interfaceStreamingRecognitionConfigOrBuilder- Returns:
- The singleUtterance.
-
setSingleUtterance
If `false` or omitted, the recognizer will perform continuous recognition (continuing to wait for and process audio even if the user pauses speaking) until the client closes the input stream (gRPC API) or until the maximum time limit has been reached. May return multiple `StreamingRecognitionResult`s with the `is_final` flag set to `true`. If `true`, the recognizer will detect a single spoken utterance. When it detects that the user has paused or stopped speaking, it will return an `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no more than one `StreamingRecognitionResult` with the `is_final` flag set to `true`. The `single_utterance` field can only be used with specified models, otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] must be set to: * `command_and_search` * `phone_call` AND additional field `useEnhanced`=`true` * The `model` field is left undefined. In this case the API auto-selects a model based on any other parameters that you set in `RecognitionConfig`.
bool single_utterance = 2;- Parameters:
value- The singleUtterance to set.- Returns:
- This builder for chaining.
-
clearSingleUtterance
If `false` or omitted, the recognizer will perform continuous recognition (continuing to wait for and process audio even if the user pauses speaking) until the client closes the input stream (gRPC API) or until the maximum time limit has been reached. May return multiple `StreamingRecognitionResult`s with the `is_final` flag set to `true`. If `true`, the recognizer will detect a single spoken utterance. When it detects that the user has paused or stopped speaking, it will return an `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no more than one `StreamingRecognitionResult` with the `is_final` flag set to `true`. The `single_utterance` field can only be used with specified models, otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] must be set to: * `command_and_search` * `phone_call` AND additional field `useEnhanced`=`true` * The `model` field is left undefined. In this case the API auto-selects a model based on any other parameters that you set in `RecognitionConfig`.
bool single_utterance = 2;- Returns:
- This builder for chaining.
-
getInterimResults
public boolean getInterimResults()If `true`, interim results (tentative hypotheses) may be returned as they become available (these interim results are indicated with the `is_final=false` flag). If `false` or omitted, only `is_final=true` result(s) are returned.
bool interim_results = 3;- Specified by:
getInterimResultsin interfaceStreamingRecognitionConfigOrBuilder- Returns:
- The interimResults.
-
setInterimResults
If `true`, interim results (tentative hypotheses) may be returned as they become available (these interim results are indicated with the `is_final=false` flag). If `false` or omitted, only `is_final=true` result(s) are returned.
bool interim_results = 3;- Parameters:
value- The interimResults to set.- Returns:
- This builder for chaining.
-
clearInterimResults
If `true`, interim results (tentative hypotheses) may be returned as they become available (these interim results are indicated with the `is_final=false` flag). If `false` or omitted, only `is_final=true` result(s) are returned.
bool interim_results = 3;- Returns:
- This builder for chaining.
-
getEnableVoiceActivityEvents
public boolean getEnableVoiceActivityEvents()If `true`, responses with voice activity speech events will be returned as they are detected.
bool enable_voice_activity_events = 5;- Specified by:
getEnableVoiceActivityEventsin interfaceStreamingRecognitionConfigOrBuilder- Returns:
- The enableVoiceActivityEvents.
-
setEnableVoiceActivityEvents
If `true`, responses with voice activity speech events will be returned as they are detected.
bool enable_voice_activity_events = 5;- Parameters:
value- The enableVoiceActivityEvents to set.- Returns:
- This builder for chaining.
-
clearEnableVoiceActivityEvents
If `true`, responses with voice activity speech events will be returned as they are detected.
bool enable_voice_activity_events = 5;- Returns:
- This builder for chaining.
-
hasVoiceActivityTimeout
public boolean hasVoiceActivityTimeout()If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent. The field `voice_activity_events` must also be set to true.
.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout voice_activity_timeout = 6;- Specified by:
hasVoiceActivityTimeoutin interfaceStreamingRecognitionConfigOrBuilder- Returns:
- Whether the voiceActivityTimeout field is set.
-
getVoiceActivityTimeout
If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent. The field `voice_activity_events` must also be set to true.
.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout voice_activity_timeout = 6;- Specified by:
getVoiceActivityTimeoutin interfaceStreamingRecognitionConfigOrBuilder- Returns:
- The voiceActivityTimeout.
-
setVoiceActivityTimeout
public StreamingRecognitionConfig.Builder setVoiceActivityTimeout(StreamingRecognitionConfig.VoiceActivityTimeout value) If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent. The field `voice_activity_events` must also be set to true.
.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout voice_activity_timeout = 6; -
setVoiceActivityTimeout
public StreamingRecognitionConfig.Builder setVoiceActivityTimeout(StreamingRecognitionConfig.VoiceActivityTimeout.Builder builderForValue) If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent. The field `voice_activity_events` must also be set to true.
.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout voice_activity_timeout = 6; -
mergeVoiceActivityTimeout
public StreamingRecognitionConfig.Builder mergeVoiceActivityTimeout(StreamingRecognitionConfig.VoiceActivityTimeout value) If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent. The field `voice_activity_events` must also be set to true.
.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout voice_activity_timeout = 6; -
clearVoiceActivityTimeout
If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent. The field `voice_activity_events` must also be set to true.
.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout voice_activity_timeout = 6; -
getVoiceActivityTimeoutBuilder
If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent. The field `voice_activity_events` must also be set to true.
.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout voice_activity_timeout = 6; -
getVoiceActivityTimeoutOrBuilder
If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent. The field `voice_activity_events` must also be set to true.
.google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout voice_activity_timeout = 6;- Specified by:
getVoiceActivityTimeoutOrBuilderin interfaceStreamingRecognitionConfigOrBuilder
-