Class RecognitionAudio.Builder (4.22.0)

public static final class RecognitionAudio.Builder extends GeneratedMessageV3.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. See audio limits.

Protobuf type google.cloud.speech.v1beta1.RecognitionAudio

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public RecognitionAudio build()
Returns
TypeDescription
RecognitionAudio

buildPartial()

public RecognitionAudio buildPartial()
Returns
TypeDescription
RecognitionAudio

clear()

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

clearAudioSource()

public RecognitionAudio.Builder clearAudioSource()
Returns
TypeDescription
RecognitionAudio.Builder

clearContent()

public RecognitionAudio.Builder clearContent()

The audio data bytes encoded as specified in RecognitionConfig. Note: as with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64.

bytes content = 1;

Returns
TypeDescription
RecognitionAudio.Builder

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearUri()

public RecognitionAudio.Builder clearUri()

URI that points to a file that contains audio data bytes as specified in RecognitionConfig. 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). For more information, see Request URIs.

string uri = 2;

Returns
TypeDescription
RecognitionAudio.Builder

clone()

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

getAudioSourceCase()

public RecognitionAudio.AudioSourceCase getAudioSourceCase()
Returns
TypeDescription
RecognitionAudio.AudioSourceCase

getContent()

public ByteString getContent()

The audio data bytes encoded as specified in RecognitionConfig. Note: as with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64.

bytes content = 1;

Returns
TypeDescription
ByteString

getDefaultInstanceForType()

public RecognitionAudio getDefaultInstanceForType()
Returns
TypeDescription
RecognitionAudio

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getUri()

public String getUri()

URI that points to a file that contains audio data bytes as specified in RecognitionConfig. 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). For more information, see Request URIs.

string uri = 2;

Returns
TypeDescription
String

getUriBytes()

public ByteString getUriBytes()

URI that points to a file that contains audio data bytes as specified in RecognitionConfig. 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). For more information, see Request URIs.

string uri = 2;

Returns
TypeDescription
ByteString

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(RecognitionAudio other)

public RecognitionAudio.Builder mergeFrom(RecognitionAudio other)
Parameter
NameDescription
otherRecognitionAudio
Returns
TypeDescription
RecognitionAudio.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setContent(ByteString value)

public RecognitionAudio.Builder setContent(ByteString value)

The audio data bytes encoded as specified in RecognitionConfig. Note: as with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64.

bytes content = 1;

Parameter
NameDescription
valueByteString
Returns
TypeDescription
RecognitionAudio.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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

setUri(String value)

public RecognitionAudio.Builder setUri(String value)

URI that points to a file that contains audio data bytes as specified in RecognitionConfig. 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). For more information, see Request URIs.

string uri = 2;

Parameter
NameDescription
valueString
Returns
TypeDescription
RecognitionAudio.Builder

setUriBytes(ByteString value)

public RecognitionAudio.Builder setUriBytes(ByteString value)

URI that points to a file that contains audio data bytes as specified in RecognitionConfig. 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). For more information, see Request URIs.

string uri = 2;

Parameter
NameDescription
valueByteString
Returns
TypeDescription
RecognitionAudio.Builder