Class StreamingTranslateSpeechConfig.Builder (0.40.0)

public static final class StreamingTranslateSpeechConfig.Builder extends GeneratedMessageV3.Builder<StreamingTranslateSpeechConfig.Builder> implements StreamingTranslateSpeechConfigOrBuilder

Config used for streaming translation.

Protobuf type google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechConfig

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public StreamingTranslateSpeechConfig build()
Returns
TypeDescription
StreamingTranslateSpeechConfig

buildPartial()

public StreamingTranslateSpeechConfig buildPartial()
Returns
TypeDescription
StreamingTranslateSpeechConfig

clear()

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

clearAudioConfig()

public StreamingTranslateSpeechConfig.Builder clearAudioConfig()

Required. The common config for all the following audio contents.

.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig audio_config = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
StreamingTranslateSpeechConfig.Builder

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearSingleUtterance()

public StreamingTranslateSpeechConfig.Builder clearSingleUtterance()

Optional. If false or omitted, the system performs continuous translation (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 StreamingTranslateSpeechResults with the is_final flag set to true.

If true, the speech translator 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 translation. When the client receives 'END_OF_SINGLE_UTTERANCE' event, the client should stop sending the requests. However, clients should keep receiving remaining responses until the stream is terminated. To construct the complete sentence in a streaming way, one should override (if 'is_final' of previous response is false), or append (if 'is_final' of previous response is true).

bool single_utterance = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
StreamingTranslateSpeechConfig.Builder

This builder for chaining.

clone()

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

getAudioConfig()

public TranslateSpeechConfig getAudioConfig()

Required. The common config for all the following audio contents.

.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig audio_config = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
TranslateSpeechConfig

The audioConfig.

getAudioConfigBuilder()

public TranslateSpeechConfig.Builder getAudioConfigBuilder()

Required. The common config for all the following audio contents.

.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig audio_config = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
TranslateSpeechConfig.Builder

getAudioConfigOrBuilder()

public TranslateSpeechConfigOrBuilder getAudioConfigOrBuilder()

Required. The common config for all the following audio contents.

.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig audio_config = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
TranslateSpeechConfigOrBuilder

getDefaultInstanceForType()

public StreamingTranslateSpeechConfig getDefaultInstanceForType()
Returns
TypeDescription
StreamingTranslateSpeechConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getSingleUtterance()

public boolean getSingleUtterance()

Optional. If false or omitted, the system performs continuous translation (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 StreamingTranslateSpeechResults with the is_final flag set to true.

If true, the speech translator 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 translation. When the client receives 'END_OF_SINGLE_UTTERANCE' event, the client should stop sending the requests. However, clients should keep receiving remaining responses until the stream is terminated. To construct the complete sentence in a streaming way, one should override (if 'is_final' of previous response is false), or append (if 'is_final' of previous response is true).

bool single_utterance = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

The singleUtterance.

hasAudioConfig()

public boolean hasAudioConfig()

Required. The common config for all the following audio contents.

.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig audio_config = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
boolean

Whether the audioConfig field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeAudioConfig(TranslateSpeechConfig value)

public StreamingTranslateSpeechConfig.Builder mergeAudioConfig(TranslateSpeechConfig value)

Required. The common config for all the following audio contents.

.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig audio_config = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueTranslateSpeechConfig
Returns
TypeDescription
StreamingTranslateSpeechConfig.Builder

mergeFrom(StreamingTranslateSpeechConfig other)

public StreamingTranslateSpeechConfig.Builder mergeFrom(StreamingTranslateSpeechConfig other)
Parameter
NameDescription
otherStreamingTranslateSpeechConfig
Returns
TypeDescription
StreamingTranslateSpeechConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setAudioConfig(TranslateSpeechConfig value)

public StreamingTranslateSpeechConfig.Builder setAudioConfig(TranslateSpeechConfig value)

Required. The common config for all the following audio contents.

.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig audio_config = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueTranslateSpeechConfig
Returns
TypeDescription
StreamingTranslateSpeechConfig.Builder

setAudioConfig(TranslateSpeechConfig.Builder builderForValue)

public StreamingTranslateSpeechConfig.Builder setAudioConfig(TranslateSpeechConfig.Builder builderForValue)

Required. The common config for all the following audio contents.

.google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig audio_config = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
builderForValueTranslateSpeechConfig.Builder
Returns
TypeDescription
StreamingTranslateSpeechConfig.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

setSingleUtterance(boolean value)

public StreamingTranslateSpeechConfig.Builder setSingleUtterance(boolean value)

Optional. If false or omitted, the system performs continuous translation (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 StreamingTranslateSpeechResults with the is_final flag set to true.

If true, the speech translator 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 translation. When the client receives 'END_OF_SINGLE_UTTERANCE' event, the client should stop sending the requests. However, clients should keep receiving remaining responses until the stream is terminated. To construct the complete sentence in a streaming way, one should override (if 'is_final' of previous response is false), or append (if 'is_final' of previous response is true).

bool single_utterance = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueboolean

The singleUtterance to set.

Returns
TypeDescription
StreamingTranslateSpeechConfig.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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