public static final class RecognitionAudio.Builder extends com.google.protobuf.GeneratedMessage.Builder<RecognitionAudio.Builder> implements RecognitionAudioOrBuilder
Contains audio data in the encoding specified in the `RecognitionConfig`. Either `content` or `uri` must be supplied. Supplying both or neither returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See [content limits](https://cloud.google.com/speech-to-text/quotas#content).Protobuf type
google.cloud.speech.v1.RecognitionAudio| Modifier and Type | Method and Description |
|---|---|
RecognitionAudio |
build() |
RecognitionAudio |
buildPartial() |
RecognitionAudio.Builder |
clear() |
RecognitionAudio.Builder |
clearAudioSource() |
RecognitionAudio.Builder |
clearContent()
The audio data bytes encoded as specified in
`RecognitionConfig`.
|
RecognitionAudio.Builder |
clearUri()
URI that points to a file that contains audio data bytes as specified in
`RecognitionConfig`.
|
RecognitionAudio.AudioSourceCase |
getAudioSourceCase() |
com.google.protobuf.ByteString |
getContent()
The audio data bytes encoded as specified in
`RecognitionConfig`.
|
RecognitionAudio |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
String |
getUri()
URI that points to a file that contains audio data bytes as specified in
`RecognitionConfig`.
|
com.google.protobuf.ByteString |
getUriBytes()
URI that points to a file that contains audio data bytes as specified in
`RecognitionConfig`.
|
boolean |
hasContent()
The audio data bytes encoded as specified in
`RecognitionConfig`.
|
boolean |
hasUri()
URI that points to a file that contains audio data bytes as specified in
`RecognitionConfig`.
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
RecognitionAudio.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
RecognitionAudio.Builder |
mergeFrom(com.google.protobuf.Message other) |
RecognitionAudio.Builder |
mergeFrom(RecognitionAudio other) |
RecognitionAudio.Builder |
setContent(com.google.protobuf.ByteString value)
The audio data bytes encoded as specified in
`RecognitionConfig`.
|
RecognitionAudio.Builder |
setUri(String value)
URI that points to a file that contains audio data bytes as specified in
`RecognitionConfig`.
|
RecognitionAudio.Builder |
setUriBytes(com.google.protobuf.ByteString value)
URI that points to a file that contains audio data bytes as specified in
`RecognitionConfig`.
|
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<RecognitionAudio.Builder>public RecognitionAudio.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessage.Builder<RecognitionAudio.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<RecognitionAudio.Builder>public RecognitionAudio getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic RecognitionAudio build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic RecognitionAudio buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic RecognitionAudio.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<RecognitionAudio.Builder>public RecognitionAudio.Builder mergeFrom(RecognitionAudio other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessage.Builder<RecognitionAudio.Builder>public RecognitionAudio.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<RecognitionAudio.Builder>IOExceptionpublic RecognitionAudio.AudioSourceCase getAudioSourceCase()
getAudioSourceCase in interface RecognitionAudioOrBuilderpublic RecognitionAudio.Builder clearAudioSource()
public boolean hasContent()
The audio data bytes encoded as specified in `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a pure binary representation, whereas JSON representations use base64.
bytes content = 1;hasContent in interface RecognitionAudioOrBuilderpublic com.google.protobuf.ByteString getContent()
The audio data bytes encoded as specified in `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a pure binary representation, whereas JSON representations use base64.
bytes content = 1;getContent in interface RecognitionAudioOrBuilderpublic RecognitionAudio.Builder setContent(com.google.protobuf.ByteString value)
The audio data bytes encoded as specified in `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a pure binary representation, whereas JSON representations use base64.
bytes content = 1;value - The content to set.public RecognitionAudio.Builder clearContent()
The audio data bytes encoded as specified in `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a pure binary representation, whereas JSON representations use base64.
bytes content = 1;public boolean hasUri()
URI that points to a file that contains audio data bytes as specified in `RecognitionConfig`. The file must not be compressed (for example, gzip). Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: `gs://bucket_name/object_name` (other URI formats return [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
string uri = 2;hasUri in interface RecognitionAudioOrBuilderpublic String getUri()
URI that points to a file that contains audio data bytes as specified in `RecognitionConfig`. The file must not be compressed (for example, gzip). Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: `gs://bucket_name/object_name` (other URI formats return [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
string uri = 2;getUri in interface RecognitionAudioOrBuilderpublic com.google.protobuf.ByteString getUriBytes()
URI that points to a file that contains audio data bytes as specified in `RecognitionConfig`. The file must not be compressed (for example, gzip). Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: `gs://bucket_name/object_name` (other URI formats return [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
string uri = 2;getUriBytes in interface RecognitionAudioOrBuilderpublic RecognitionAudio.Builder setUri(String value)
URI that points to a file that contains audio data bytes as specified in `RecognitionConfig`. The file must not be compressed (for example, gzip). Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: `gs://bucket_name/object_name` (other URI formats return [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
string uri = 2;value - The uri to set.public RecognitionAudio.Builder clearUri()
URI that points to a file that contains audio data bytes as specified in `RecognitionConfig`. The file must not be compressed (for example, gzip). Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: `gs://bucket_name/object_name` (other URI formats return [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
string uri = 2;public RecognitionAudio.Builder setUriBytes(com.google.protobuf.ByteString value)
URI that points to a file that contains audio data bytes as specified in `RecognitionConfig`. The file must not be compressed (for example, gzip). Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: `gs://bucket_name/object_name` (other URI formats return [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
string uri = 2;value - The bytes for uri to set.Copyright © 2026 Google LLC. All rights reserved.