Class StreamingRecognitionFeatures.Builder (4.78.0)

public static final class StreamingRecognitionFeatures.Builder extends GeneratedMessage.Builder<StreamingRecognitionFeatures.Builder> implements StreamingRecognitionFeaturesOrBuilder

Available recognition features specific to streaming recognition requests.

Protobuf type google.cloud.speech.v2.StreamingRecognitionFeatures

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

build()

public StreamingRecognitionFeatures build()
Returns
Type Description
StreamingRecognitionFeatures

buildPartial()

public StreamingRecognitionFeatures buildPartial()
Returns
Type Description
StreamingRecognitionFeatures

clear()

public StreamingRecognitionFeatures.Builder clear()
Returns
Type Description
StreamingRecognitionFeatures.Builder
Overrides

clearEnableVoiceActivityEvents()

public StreamingRecognitionFeatures.Builder clearEnableVoiceActivityEvents()

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

bool enable_voice_activity_events = 1;

Returns
Type Description
StreamingRecognitionFeatures.Builder

This builder for chaining.

clearInterimResults()

public StreamingRecognitionFeatures.Builder clearInterimResults()

Whether or not to stream interim results to the client. If set to true, interim results will be streamed to the client. Otherwise, only the final response will be streamed back.

bool interim_results = 2;

Returns
Type Description
StreamingRecognitionFeatures.Builder

This builder for chaining.

clearVoiceActivityTimeout()

public StreamingRecognitionFeatures.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.v2.StreamingRecognitionFeatures.VoiceActivityTimeout voice_activity_timeout = 3;

Returns
Type Description
StreamingRecognitionFeatures.Builder

getDefaultInstanceForType()

public StreamingRecognitionFeatures getDefaultInstanceForType()
Returns
Type Description
StreamingRecognitionFeatures

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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 = 1;

Returns
Type Description
boolean

The enableVoiceActivityEvents.

getInterimResults()

public boolean getInterimResults()

Whether or not to stream interim results to the client. If set to true, interim results will be streamed to the client. Otherwise, only the final response will be streamed back.

bool interim_results = 2;

Returns
Type Description
boolean

The interimResults.

getVoiceActivityTimeout()

public StreamingRecognitionFeatures.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.v2.StreamingRecognitionFeatures.VoiceActivityTimeout voice_activity_timeout = 3;

Returns
Type Description
StreamingRecognitionFeatures.VoiceActivityTimeout

The voiceActivityTimeout.

getVoiceActivityTimeoutBuilder()

public StreamingRecognitionFeatures.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.v2.StreamingRecognitionFeatures.VoiceActivityTimeout voice_activity_timeout = 3;

Returns
Type Description
StreamingRecognitionFeatures.VoiceActivityTimeout.Builder

getVoiceActivityTimeoutOrBuilder()

public StreamingRecognitionFeatures.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.v2.StreamingRecognitionFeatures.VoiceActivityTimeout voice_activity_timeout = 3;

Returns
Type Description
StreamingRecognitionFeatures.VoiceActivityTimeoutOrBuilder

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.v2.StreamingRecognitionFeatures.VoiceActivityTimeout voice_activity_timeout = 3;

Returns
Type Description
boolean

Whether the voiceActivityTimeout field is set.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(StreamingRecognitionFeatures other)

public StreamingRecognitionFeatures.Builder mergeFrom(StreamingRecognitionFeatures other)
Parameter
Name Description
other StreamingRecognitionFeatures
Returns
Type Description
StreamingRecognitionFeatures.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public StreamingRecognitionFeatures.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
StreamingRecognitionFeatures.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public StreamingRecognitionFeatures.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
StreamingRecognitionFeatures.Builder
Overrides

mergeVoiceActivityTimeout(StreamingRecognitionFeatures.VoiceActivityTimeout value)

public StreamingRecognitionFeatures.Builder mergeVoiceActivityTimeout(StreamingRecognitionFeatures.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.v2.StreamingRecognitionFeatures.VoiceActivityTimeout voice_activity_timeout = 3;

Parameter
Name Description
value StreamingRecognitionFeatures.VoiceActivityTimeout
Returns
Type Description
StreamingRecognitionFeatures.Builder

setEnableVoiceActivityEvents(boolean value)

public StreamingRecognitionFeatures.Builder setEnableVoiceActivityEvents(boolean value)

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

bool enable_voice_activity_events = 1;

Parameter
Name Description
value boolean

The enableVoiceActivityEvents to set.

Returns
Type Description
StreamingRecognitionFeatures.Builder

This builder for chaining.

setInterimResults(boolean value)

public StreamingRecognitionFeatures.Builder setInterimResults(boolean value)

Whether or not to stream interim results to the client. If set to true, interim results will be streamed to the client. Otherwise, only the final response will be streamed back.

bool interim_results = 2;

Parameter
Name Description
value boolean

The interimResults to set.

Returns
Type Description
StreamingRecognitionFeatures.Builder

This builder for chaining.

setVoiceActivityTimeout(StreamingRecognitionFeatures.VoiceActivityTimeout value)

public StreamingRecognitionFeatures.Builder setVoiceActivityTimeout(StreamingRecognitionFeatures.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.v2.StreamingRecognitionFeatures.VoiceActivityTimeout voice_activity_timeout = 3;

Parameter
Name Description
value StreamingRecognitionFeatures.VoiceActivityTimeout
Returns
Type Description
StreamingRecognitionFeatures.Builder

setVoiceActivityTimeout(StreamingRecognitionFeatures.VoiceActivityTimeout.Builder builderForValue)

public StreamingRecognitionFeatures.Builder setVoiceActivityTimeout(StreamingRecognitionFeatures.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.v2.StreamingRecognitionFeatures.VoiceActivityTimeout voice_activity_timeout = 3;

Parameter
Name Description
builderForValue StreamingRecognitionFeatures.VoiceActivityTimeout.Builder
Returns
Type Description
StreamingRecognitionFeatures.Builder