Class StreamingRecognitionConfig.Builder (4.32.0)

public static final class StreamingRecognitionConfig.Builder extends GeneratedMessageV3.Builder<StreamingRecognitionConfig.Builder> implements StreamingRecognitionConfigOrBuilder

Provides information to the recognizer that specifies how to process the request.

Protobuf type google.cloud.speech.v1.StreamingRecognitionConfig

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public StreamingRecognitionConfig.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
StreamingRecognitionConfig.Builder
Overrides

build()

public StreamingRecognitionConfig build()
Returns
TypeDescription
StreamingRecognitionConfig

buildPartial()

public StreamingRecognitionConfig buildPartial()
Returns
TypeDescription
StreamingRecognitionConfig

clear()

public StreamingRecognitionConfig.Builder clear()
Returns
TypeDescription
StreamingRecognitionConfig.Builder
Overrides

clearConfig()

public StreamingRecognitionConfig.Builder 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];

Returns
TypeDescription
StreamingRecognitionConfig.Builder

clearEnableVoiceActivityEvents()

public StreamingRecognitionConfig.Builder clearEnableVoiceActivityEvents()

If true, responses with voice activity speech events will be returned as they are detected.

bool enable_voice_activity_events = 5;

Returns
TypeDescription
StreamingRecognitionConfig.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public StreamingRecognitionConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
StreamingRecognitionConfig.Builder
Overrides

clearInterimResults()

public StreamingRecognitionConfig.Builder 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
TypeDescription
StreamingRecognitionConfig.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public StreamingRecognitionConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
StreamingRecognitionConfig.Builder
Overrides

clearSingleUtterance()

public StreamingRecognitionConfig.Builder 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 StreamingRecognitionResults 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
TypeDescription
StreamingRecognitionConfig.Builder

This builder for chaining.

clearVoiceActivityTimeout()

public StreamingRecognitionConfig.Builder 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;

Returns
TypeDescription
StreamingRecognitionConfig.Builder

clone()

public StreamingRecognitionConfig.Builder clone()
Returns
TypeDescription
StreamingRecognitionConfig.Builder
Overrides

getConfig()

public RecognitionConfig 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];

Returns
TypeDescription
RecognitionConfig

The config.

getConfigBuilder()

public RecognitionConfig.Builder 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];

Returns
TypeDescription
RecognitionConfig.Builder

getConfigOrBuilder()

public RecognitionConfigOrBuilder 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];

Returns
TypeDescription
RecognitionConfigOrBuilder

getDefaultInstanceForType()

public StreamingRecognitionConfig getDefaultInstanceForType()
Returns
TypeDescription
StreamingRecognitionConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

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;

Returns
TypeDescription
boolean

The enableVoiceActivityEvents.

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;

Returns
TypeDescription
boolean

The interimResults.

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 StreamingRecognitionResults 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
TypeDescription
boolean

The singleUtterance.

getVoiceActivityTimeout()

public StreamingRecognitionConfig.VoiceActivityTimeout 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;

Returns
TypeDescription
StreamingRecognitionConfig.VoiceActivityTimeout

The voiceActivityTimeout.

getVoiceActivityTimeoutBuilder()

public StreamingRecognitionConfig.VoiceActivityTimeout.Builder 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;

Returns
TypeDescription
StreamingRecognitionConfig.VoiceActivityTimeout.Builder

getVoiceActivityTimeoutOrBuilder()

public StreamingRecognitionConfig.VoiceActivityTimeoutOrBuilder 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;

Returns
TypeDescription
StreamingRecognitionConfig.VoiceActivityTimeoutOrBuilder

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];

Returns
TypeDescription
boolean

Whether the config field is set.

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;

Returns
TypeDescription
boolean

Whether the voiceActivityTimeout field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeConfig(RecognitionConfig value)

public StreamingRecognitionConfig.Builder mergeConfig(RecognitionConfig value)

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];

Parameter
NameDescription
valueRecognitionConfig
Returns
TypeDescription
StreamingRecognitionConfig.Builder

mergeFrom(StreamingRecognitionConfig other)

public StreamingRecognitionConfig.Builder mergeFrom(StreamingRecognitionConfig other)
Parameter
NameDescription
otherStreamingRecognitionConfig
Returns
TypeDescription
StreamingRecognitionConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public StreamingRecognitionConfig.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
StreamingRecognitionConfig.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public StreamingRecognitionConfig.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
StreamingRecognitionConfig.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final StreamingRecognitionConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
StreamingRecognitionConfig.Builder
Overrides

mergeVoiceActivityTimeout(StreamingRecognitionConfig.VoiceActivityTimeout value)

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;

Parameter
NameDescription
valueStreamingRecognitionConfig.VoiceActivityTimeout
Returns
TypeDescription
StreamingRecognitionConfig.Builder

setConfig(RecognitionConfig value)

public StreamingRecognitionConfig.Builder setConfig(RecognitionConfig value)

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];

Parameter
NameDescription
valueRecognitionConfig
Returns
TypeDescription
StreamingRecognitionConfig.Builder

setConfig(RecognitionConfig.Builder builderForValue)

public StreamingRecognitionConfig.Builder setConfig(RecognitionConfig.Builder builderForValue)

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];

Parameter
NameDescription
builderForValueRecognitionConfig.Builder
Returns
TypeDescription
StreamingRecognitionConfig.Builder

setEnableVoiceActivityEvents(boolean value)

public StreamingRecognitionConfig.Builder setEnableVoiceActivityEvents(boolean value)

If true, responses with voice activity speech events will be returned as they are detected.

bool enable_voice_activity_events = 5;

Parameter
NameDescription
valueboolean

The enableVoiceActivityEvents to set.

Returns
TypeDescription
StreamingRecognitionConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public StreamingRecognitionConfig.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
StreamingRecognitionConfig.Builder
Overrides

setInterimResults(boolean value)

public StreamingRecognitionConfig.Builder 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). If false or omitted, only is_final=true result(s) are returned.

bool interim_results = 3;

Parameter
NameDescription
valueboolean

The interimResults to set.

Returns
TypeDescription
StreamingRecognitionConfig.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public StreamingRecognitionConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
StreamingRecognitionConfig.Builder
Overrides

setSingleUtterance(boolean value)

public StreamingRecognitionConfig.Builder 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. May return multiple StreamingRecognitionResults 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;

Parameter
NameDescription
valueboolean

The singleUtterance to set.

Returns
TypeDescription
StreamingRecognitionConfig.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final StreamingRecognitionConfig.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
StreamingRecognitionConfig.Builder
Overrides

setVoiceActivityTimeout(StreamingRecognitionConfig.VoiceActivityTimeout value)

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;

Parameter
NameDescription
valueStreamingRecognitionConfig.VoiceActivityTimeout
Returns
TypeDescription
StreamingRecognitionConfig.Builder

setVoiceActivityTimeout(StreamingRecognitionConfig.VoiceActivityTimeout.Builder builderForValue)

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;

Parameter
NameDescription
builderForValueStreamingRecognitionConfig.VoiceActivityTimeout.Builder
Returns
TypeDescription
StreamingRecognitionConfig.Builder