public static final class StreamingRecognizeResponse.Builder extends GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder> implements StreamingRecognizeResponseOrBuilder
`StreamingRecognizeResponse` is the only message returned to the client by `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` messages are streamed back to the client. If there is no recognizable audio, and `single_utterance` is set to false, then no messages are streamed back to the client. Here's an example of a series of ten `StreamingRecognizeResponse`s that might be returned while processing audio: 1. results { alternatives { transcript: "tube" } stability: 0.01 } 2. results { alternatives { transcript: "to be a" } stability: 0.01 } 3. results { alternatives { transcript: "to be" } stability: 0.9 } results { alternatives { transcript: " or not to be" } stability: 0.01 } 4. results { alternatives { transcript: "to be or not to be" confidence: 0.92 } alternatives { transcript: "to bee or not to bee" } is_final: true } 5. results { alternatives { transcript: " that's" } stability: 0.01 } 6. results { alternatives { transcript: " that is" } stability: 0.9 } results { alternatives { transcript: " the question" } stability: 0.01 } 7. results { alternatives { transcript: " that is the question" confidence: 0.98 } alternatives { transcript: " that was the question" } is_final: true } Notes: - Only two of the above responses #4 and #7 contain final results; they are indicated by `is_final: true`. Concatenating these together generates the full transcript: "to be or not to be that is the question". - The others contain interim `results`. #3 and #6 contain two interim `results`: the first portion has a high stability and is less likely to change; the second portion has a low stability and is very likely to change. A UI designer might choose to show only high stability `results`. - The specific `stability` and `confidence` values shown above are only for illustrative purposes. Actual values may vary. - In each response, only one of these fields will be set: `error`, `speech_event_type`, or one or more (repeated) `results`.Protobuf type
google.cloud.speech.v1.StreamingRecognizeResponse
Modifier and Type | Method and Description |
---|---|
StreamingRecognizeResponse.Builder |
addAllResults(java.lang.Iterable<? extends StreamingRecognitionResult> values)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognizeResponse.Builder |
addRepeatedField(Descriptors.FieldDescriptor field,
java.lang.Object value) |
StreamingRecognizeResponse.Builder |
addResults(int index,
StreamingRecognitionResult.Builder builderForValue)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognizeResponse.Builder |
addResults(int index,
StreamingRecognitionResult value)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognizeResponse.Builder |
addResults(StreamingRecognitionResult.Builder builderForValue)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognizeResponse.Builder |
addResults(StreamingRecognitionResult value)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognitionResult.Builder |
addResultsBuilder()
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognitionResult.Builder |
addResultsBuilder(int index)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognizeResponse |
build() |
StreamingRecognizeResponse |
buildPartial() |
StreamingRecognizeResponse.Builder |
clear() |
StreamingRecognizeResponse.Builder |
clearError()
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
specifies the error for the operation.
|
StreamingRecognizeResponse.Builder |
clearField(Descriptors.FieldDescriptor field) |
StreamingRecognizeResponse.Builder |
clearOneof(Descriptors.OneofDescriptor oneof) |
StreamingRecognizeResponse.Builder |
clearResults()
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognizeResponse.Builder |
clearSpeechEventType()
*Output-only* Indicates the type of speech event.
|
StreamingRecognizeResponse.Builder |
clone() |
StreamingRecognizeResponse |
getDefaultInstanceForType() |
static Descriptors.Descriptor |
getDescriptor() |
Descriptors.Descriptor |
getDescriptorForType() |
Status |
getError()
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
specifies the error for the operation.
|
Status.Builder |
getErrorBuilder()
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
specifies the error for the operation.
|
StatusOrBuilder |
getErrorOrBuilder()
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
specifies the error for the operation.
|
StreamingRecognitionResult |
getResults(int index)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognitionResult.Builder |
getResultsBuilder(int index)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
java.util.List<StreamingRecognitionResult.Builder> |
getResultsBuilderList()
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
int |
getResultsCount()
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
java.util.List<StreamingRecognitionResult> |
getResultsList()
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognitionResultOrBuilder |
getResultsOrBuilder(int index)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
java.util.List<? extends StreamingRecognitionResultOrBuilder> |
getResultsOrBuilderList()
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognizeResponse.SpeechEventType |
getSpeechEventType()
*Output-only* Indicates the type of speech event.
|
int |
getSpeechEventTypeValue()
*Output-only* Indicates the type of speech event.
|
boolean |
hasError()
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
specifies the error for the operation.
|
protected GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
StreamingRecognizeResponse.Builder |
mergeError(Status value)
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
specifies the error for the operation.
|
StreamingRecognizeResponse.Builder |
mergeFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
StreamingRecognizeResponse.Builder |
mergeFrom(Message other) |
StreamingRecognizeResponse.Builder |
mergeFrom(StreamingRecognizeResponse other) |
StreamingRecognizeResponse.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields) |
StreamingRecognizeResponse.Builder |
removeResults(int index)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognizeResponse.Builder |
setError(Status.Builder builderForValue)
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
specifies the error for the operation.
|
StreamingRecognizeResponse.Builder |
setError(Status value)
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that
specifies the error for the operation.
|
StreamingRecognizeResponse.Builder |
setField(Descriptors.FieldDescriptor field,
java.lang.Object value) |
StreamingRecognizeResponse.Builder |
setRepeatedField(Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) |
StreamingRecognizeResponse.Builder |
setResults(int index,
StreamingRecognitionResult.Builder builderForValue)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognizeResponse.Builder |
setResults(int index,
StreamingRecognitionResult value)
*Output-only* This repeated list contains zero or more results that
correspond to consecutive portions of the audio currently being processed.
|
StreamingRecognizeResponse.Builder |
setSpeechEventType(StreamingRecognizeResponse.SpeechEventType value)
*Output-only* Indicates the type of speech event.
|
StreamingRecognizeResponse.Builder |
setSpeechEventTypeValue(int value)
*Output-only* Indicates the type of speech event.
|
StreamingRecognizeResponse.Builder |
setUnknownFields(UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
mergeFrom
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>
public StreamingRecognizeResponse.Builder clear()
clear
in interface Message.Builder
clear
in interface MessageLite.Builder
clear
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>
public Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface Message.Builder
getDescriptorForType
in interface MessageOrBuilder
getDescriptorForType
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>
public StreamingRecognizeResponse getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
public StreamingRecognizeResponse build()
build
in interface Message.Builder
build
in interface MessageLite.Builder
public StreamingRecognizeResponse buildPartial()
buildPartial
in interface Message.Builder
buildPartial
in interface MessageLite.Builder
public StreamingRecognizeResponse.Builder clone()
clone
in interface Message.Builder
clone
in interface MessageLite.Builder
clone
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>
public StreamingRecognizeResponse.Builder setField(Descriptors.FieldDescriptor field, java.lang.Object value)
setField
in interface Message.Builder
setField
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>
public StreamingRecognizeResponse.Builder clearField(Descriptors.FieldDescriptor field)
clearField
in interface Message.Builder
clearField
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>
public StreamingRecognizeResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
clearOneof
in interface Message.Builder
clearOneof
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>
public StreamingRecognizeResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, java.lang.Object value)
setRepeatedField
in interface Message.Builder
setRepeatedField
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>
public StreamingRecognizeResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, java.lang.Object value)
addRepeatedField
in interface Message.Builder
addRepeatedField
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>
public StreamingRecognizeResponse.Builder mergeFrom(Message other)
mergeFrom
in interface Message.Builder
mergeFrom
in class AbstractMessage.Builder<StreamingRecognizeResponse.Builder>
public StreamingRecognizeResponse.Builder mergeFrom(StreamingRecognizeResponse other)
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>
public StreamingRecognizeResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom
in interface Message.Builder
mergeFrom
in interface MessageLite.Builder
mergeFrom
in class AbstractMessage.Builder<StreamingRecognizeResponse.Builder>
java.io.IOException
public boolean hasError()
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that specifies the error for the operation.
.google.rpc.Status error = 1;
hasError
in interface StreamingRecognizeResponseOrBuilder
public Status getError()
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that specifies the error for the operation.
.google.rpc.Status error = 1;
getError
in interface StreamingRecognizeResponseOrBuilder
public StreamingRecognizeResponse.Builder setError(Status value)
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that specifies the error for the operation.
.google.rpc.Status error = 1;
public StreamingRecognizeResponse.Builder setError(Status.Builder builderForValue)
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that specifies the error for the operation.
.google.rpc.Status error = 1;
public StreamingRecognizeResponse.Builder mergeError(Status value)
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that specifies the error for the operation.
.google.rpc.Status error = 1;
public StreamingRecognizeResponse.Builder clearError()
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that specifies the error for the operation.
.google.rpc.Status error = 1;
public Status.Builder getErrorBuilder()
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that specifies the error for the operation.
.google.rpc.Status error = 1;
public StatusOrBuilder getErrorOrBuilder()
*Output-only* If set, returns a [google.rpc.Status][google.rpc.Status] message that specifies the error for the operation.
.google.rpc.Status error = 1;
getErrorOrBuilder
in interface StreamingRecognizeResponseOrBuilder
public java.util.List<StreamingRecognitionResult> getResultsList()
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
getResultsList
in interface StreamingRecognizeResponseOrBuilder
public int getResultsCount()
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
getResultsCount
in interface StreamingRecognizeResponseOrBuilder
public StreamingRecognitionResult getResults(int index)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
getResults
in interface StreamingRecognizeResponseOrBuilder
public StreamingRecognizeResponse.Builder setResults(int index, StreamingRecognitionResult value)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public StreamingRecognizeResponse.Builder setResults(int index, StreamingRecognitionResult.Builder builderForValue)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public StreamingRecognizeResponse.Builder addResults(StreamingRecognitionResult value)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public StreamingRecognizeResponse.Builder addResults(int index, StreamingRecognitionResult value)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public StreamingRecognizeResponse.Builder addResults(StreamingRecognitionResult.Builder builderForValue)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public StreamingRecognizeResponse.Builder addResults(int index, StreamingRecognitionResult.Builder builderForValue)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public StreamingRecognizeResponse.Builder addAllResults(java.lang.Iterable<? extends StreamingRecognitionResult> values)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public StreamingRecognizeResponse.Builder clearResults()
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public StreamingRecognizeResponse.Builder removeResults(int index)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public StreamingRecognitionResult.Builder getResultsBuilder(int index)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public StreamingRecognitionResultOrBuilder getResultsOrBuilder(int index)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
getResultsOrBuilder
in interface StreamingRecognizeResponseOrBuilder
public java.util.List<? extends StreamingRecognitionResultOrBuilder> getResultsOrBuilderList()
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
getResultsOrBuilderList
in interface StreamingRecognizeResponseOrBuilder
public StreamingRecognitionResult.Builder addResultsBuilder()
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public StreamingRecognitionResult.Builder addResultsBuilder(int index)
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public java.util.List<StreamingRecognitionResult.Builder> getResultsBuilderList()
*Output-only* This repeated list contains zero or more results that correspond to consecutive portions of the audio currently being processed. It contains zero or more `is_final=false` results followed by zero or one `is_final=true` result (the newly settled portion).
repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2;
public int getSpeechEventTypeValue()
*Output-only* Indicates the type of speech event.
.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4;
getSpeechEventTypeValue
in interface StreamingRecognizeResponseOrBuilder
public StreamingRecognizeResponse.Builder setSpeechEventTypeValue(int value)
*Output-only* Indicates the type of speech event.
.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4;
public StreamingRecognizeResponse.SpeechEventType getSpeechEventType()
*Output-only* Indicates the type of speech event.
.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4;
getSpeechEventType
in interface StreamingRecognizeResponseOrBuilder
public StreamingRecognizeResponse.Builder setSpeechEventType(StreamingRecognizeResponse.SpeechEventType value)
*Output-only* Indicates the type of speech event.
.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4;
public StreamingRecognizeResponse.Builder clearSpeechEventType()
*Output-only* Indicates the type of speech event.
.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4;
public final StreamingRecognizeResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
setUnknownFields
in interface Message.Builder
setUnknownFields
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>
public final StreamingRecognizeResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
mergeUnknownFields
in interface Message.Builder
mergeUnknownFields
in class GeneratedMessageV3.Builder<StreamingRecognizeResponse.Builder>