public static final class SpeechRecognitionResult.Builder extends GeneratedMessage.Builder<SpeechRecognitionResult.Builder> implements SpeechRecognitionResultOrBuilderA speech recognition result corresponding to a portion of the audio.
Protobuf type google.cloud.speech.v1.SpeechRecognitionResult
Inheritance
java.lang.Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessage.Builder > SpeechRecognitionResult.BuilderImplements
SpeechRecognitionResultOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
Methods
addAllAlternatives(Iterable<? extends SpeechRecognitionAlternative> values)
public SpeechRecognitionResult.Builder addAllAlternatives(Iterable<? extends SpeechRecognitionAlternative> values) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameter | |
|---|---|
| Name | Description |
values |
Iterable<? extends com.google.cloud.speech.v1.SpeechRecognitionAlternative> |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
addAlternatives(SpeechRecognitionAlternative value)
public SpeechRecognitionResult.Builder addAlternatives(SpeechRecognitionAlternative value) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameter | |
|---|---|
| Name | Description |
value |
SpeechRecognitionAlternative |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
addAlternatives(SpeechRecognitionAlternative.Builder builderForValue)
public SpeechRecognitionResult.Builder addAlternatives(SpeechRecognitionAlternative.Builder builderForValue) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameter | |
|---|---|
| Name | Description |
builderForValue |
SpeechRecognitionAlternative.Builder |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
addAlternatives(int index, SpeechRecognitionAlternative value)
public SpeechRecognitionResult.Builder addAlternatives(int index, SpeechRecognitionAlternative value) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameters | |
|---|---|
| Name | Description |
index |
int |
value |
SpeechRecognitionAlternative |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
addAlternatives(int index, SpeechRecognitionAlternative.Builder builderForValue)
public SpeechRecognitionResult.Builder addAlternatives(int index, SpeechRecognitionAlternative.Builder builderForValue) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameters | |
|---|---|
| Name | Description |
index |
int |
builderForValue |
SpeechRecognitionAlternative.Builder |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
addAlternativesBuilder()
public SpeechRecognitionAlternative.Builder addAlternativesBuilder() May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionAlternative.Builder |
|
addAlternativesBuilder(int index)
public SpeechRecognitionAlternative.Builder addAlternativesBuilder(int index) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameter | |
|---|---|
| Name | Description |
index |
int |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionAlternative.Builder |
|
build()
public SpeechRecognitionResult build()| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult |
|
buildPartial()
public SpeechRecognitionResult buildPartial()| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult |
|
clear()
public SpeechRecognitionResult.Builder clear()| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
clearAlternatives()
public SpeechRecognitionResult.Builder clearAlternatives() May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
clearChannelTag()
public SpeechRecognitionResult.Builder clearChannelTag()For multi-channel audio, this is the channel number corresponding to the recognized result for the audio from that channel. For audio_channel_count = N, its output values can range from '1' to 'N'.
int32 channel_tag = 2;
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
This builder for chaining. |
clearLanguageCode()
public SpeechRecognitionResult.Builder clearLanguageCode()Output only. The BCP-47 language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio.
string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
This builder for chaining. |
clearResultEndTime()
public SpeechRecognitionResult.Builder clearResultEndTime()Time offset of the end of this result relative to the beginning of the audio.
.google.protobuf.Duration result_end_time = 4;
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
getAlternatives(int index)
public SpeechRecognitionAlternative getAlternatives(int index) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameter | |
|---|---|
| Name | Description |
index |
int |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionAlternative |
|
getAlternativesBuilder(int index)
public SpeechRecognitionAlternative.Builder getAlternativesBuilder(int index) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameter | |
|---|---|
| Name | Description |
index |
int |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionAlternative.Builder |
|
getAlternativesBuilderList()
public List<SpeechRecognitionAlternative.Builder> getAlternativesBuilderList() May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Returns | |
|---|---|
| Type | Description |
List<Builder> |
|
getAlternativesCount()
public int getAlternativesCount() May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Returns | |
|---|---|
| Type | Description |
int |
|
getAlternativesList()
public List<SpeechRecognitionAlternative> getAlternativesList() May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Returns | |
|---|---|
| Type | Description |
List<SpeechRecognitionAlternative> |
|
getAlternativesOrBuilder(int index)
public SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder(int index) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameter | |
|---|---|
| Name | Description |
index |
int |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionAlternativeOrBuilder |
|
getAlternativesOrBuilderList()
public List<? extends SpeechRecognitionAlternativeOrBuilder> getAlternativesOrBuilderList() May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Returns | |
|---|---|
| Type | Description |
List<? extends com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> |
|
getChannelTag()
public int getChannelTag()For multi-channel audio, this is the channel number corresponding to the recognized result for the audio from that channel. For audio_channel_count = N, its output values can range from '1' to 'N'.
int32 channel_tag = 2;
| Returns | |
|---|---|
| Type | Description |
int |
The channelTag. |
getDefaultInstanceForType()
public SpeechRecognitionResult getDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult |
|
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
getLanguageCode()
public String getLanguageCode()Output only. The BCP-47 language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio.
string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
String |
The languageCode. |
getLanguageCodeBytes()
public ByteString getLanguageCodeBytes()Output only. The BCP-47 language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio.
string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for languageCode. |
getResultEndTime()
public Duration getResultEndTime()Time offset of the end of this result relative to the beginning of the audio.
.google.protobuf.Duration result_end_time = 4;
| Returns | |
|---|---|
| Type | Description |
Duration |
The resultEndTime. |
getResultEndTimeBuilder()
public Duration.Builder getResultEndTimeBuilder()Time offset of the end of this result relative to the beginning of the audio.
.google.protobuf.Duration result_end_time = 4;
| Returns | |
|---|---|
| Type | Description |
Builder |
|
getResultEndTimeOrBuilder()
public DurationOrBuilder getResultEndTimeOrBuilder()Time offset of the end of this result relative to the beginning of the audio.
.google.protobuf.Duration result_end_time = 4;
| Returns | |
|---|---|
| Type | Description |
DurationOrBuilder |
|
hasResultEndTime()
public boolean hasResultEndTime()Time offset of the end of this result relative to the beginning of the audio.
.google.protobuf.Duration result_end_time = 4;
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the resultEndTime field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()| Returns | |
|---|---|
| Type | Description |
FieldAccessorTable |
|
isInitialized()
public final boolean isInitialized()| Returns | |
|---|---|
| Type | Description |
boolean |
|
mergeFrom(SpeechRecognitionResult other)
public SpeechRecognitionResult.Builder mergeFrom(SpeechRecognitionResult other)| Parameter | |
|---|---|
| Name | Description |
other |
SpeechRecognitionResult |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public SpeechRecognitionResult.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
mergeFrom(Message other)
public SpeechRecognitionResult.Builder mergeFrom(Message other)| Parameter | |
|---|---|
| Name | Description |
other |
Message |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
mergeResultEndTime(Duration value)
public SpeechRecognitionResult.Builder mergeResultEndTime(Duration value)Time offset of the end of this result relative to the beginning of the audio.
.google.protobuf.Duration result_end_time = 4;
| Parameter | |
|---|---|
| Name | Description |
value |
Duration |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
removeAlternatives(int index)
public SpeechRecognitionResult.Builder removeAlternatives(int index) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameter | |
|---|---|
| Name | Description |
index |
int |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
setAlternatives(int index, SpeechRecognitionAlternative value)
public SpeechRecognitionResult.Builder setAlternatives(int index, SpeechRecognitionAlternative value) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameters | |
|---|---|
| Name | Description |
index |
int |
value |
SpeechRecognitionAlternative |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
setAlternatives(int index, SpeechRecognitionAlternative.Builder builderForValue)
public SpeechRecognitionResult.Builder setAlternatives(int index, SpeechRecognitionAlternative.Builder builderForValue) May contain one or more recognition hypotheses (up to the
maximum specified in max_alternatives).
These alternatives are ordered in terms of accuracy, with the top (first)
alternative being the most probable, as ranked by the recognizer.
repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1;
| Parameters | |
|---|---|
| Name | Description |
index |
int |
builderForValue |
SpeechRecognitionAlternative.Builder |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
setChannelTag(int value)
public SpeechRecognitionResult.Builder setChannelTag(int value)For multi-channel audio, this is the channel number corresponding to the recognized result for the audio from that channel. For audio_channel_count = N, its output values can range from '1' to 'N'.
int32 channel_tag = 2;
| Parameter | |
|---|---|
| Name | Description |
value |
intThe channelTag to set. |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
This builder for chaining. |
setLanguageCode(String value)
public SpeechRecognitionResult.Builder setLanguageCode(String value)Output only. The BCP-47 language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio.
string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe languageCode to set. |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
This builder for chaining. |
setLanguageCodeBytes(ByteString value)
public SpeechRecognitionResult.Builder setLanguageCodeBytes(ByteString value)Output only. The BCP-47 language tag of the language in this result. This language code was detected to have the most likelihood of being spoken in the audio.
string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes for languageCode to set. |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
This builder for chaining. |
setResultEndTime(Duration value)
public SpeechRecognitionResult.Builder setResultEndTime(Duration value)Time offset of the end of this result relative to the beginning of the audio.
.google.protobuf.Duration result_end_time = 4;
| Parameter | |
|---|---|
| Name | Description |
value |
Duration |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|
setResultEndTime(Duration.Builder builderForValue)
public SpeechRecognitionResult.Builder setResultEndTime(Duration.Builder builderForValue)Time offset of the end of this result relative to the beginning of the audio.
.google.protobuf.Duration result_end_time = 4;
| Parameter | |
|---|---|
| Name | Description |
builderForValue |
Builder |
| Returns | |
|---|---|
| Type | Description |
SpeechRecognitionResult.Builder |
|