Class RecognitionAudio.Builder (4.78.0)

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

Protobuf type google.cloud.speech.v1p1beta1.RecognitionAudio

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

build()

public RecognitionAudio build()
Returns
Type Description
RecognitionAudio

buildPartial()

public RecognitionAudio buildPartial()
Returns
Type Description
RecognitionAudio

clear()

public RecognitionAudio.Builder clear()
Returns
Type Description
RecognitionAudio.Builder
Overrides

clearAudioSource()

public RecognitionAudio.Builder clearAudioSource()
Returns
Type Description
RecognitionAudio.Builder

clearContent()

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;

Returns
Type Description
RecognitionAudio.Builder

This builder for chaining.

clearUri()

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). For more information, see Request URIs.

string uri = 2;

Returns
Type Description
RecognitionAudio.Builder

This builder for chaining.

getAudioSourceCase()

public RecognitionAudio.AudioSourceCase getAudioSourceCase()
Returns
Type Description
RecognitionAudio.AudioSourceCase

getContent()

public 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;

Returns
Type Description
ByteString

The content.

getDefaultInstanceForType()

public RecognitionAudio getDefaultInstanceForType()
Returns
Type Description
RecognitionAudio

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getUri()

public 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). For more information, see Request URIs.

string uri = 2;

Returns
Type Description
String

The uri.

getUriBytes()

public 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). For more information, see Request URIs.

string uri = 2;

Returns
Type Description
ByteString

The bytes for uri.

hasContent()

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;

Returns
Type Description
boolean

Whether the content field is set.

hasUri()

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). For more information, see Request URIs.

string uri = 2;

Returns
Type Description
boolean

Whether the uri field is set.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(RecognitionAudio other)

public RecognitionAudio.Builder mergeFrom(RecognitionAudio other)
Parameter
Name Description
other RecognitionAudio
Returns
Type Description
RecognitionAudio.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public RecognitionAudio.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
RecognitionAudio.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public RecognitionAudio.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
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, proto buffers use a pure binary representation, whereas JSON representations use base64.

bytes content = 1;

Parameter
Name Description
value ByteString

The content to set.

Returns
Type Description
RecognitionAudio.Builder

This builder for chaining.

setUri(String value)

public 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). For more information, see Request URIs.

string uri = 2;

Parameter
Name Description
value String

The uri to set.

Returns
Type Description
RecognitionAudio.Builder

This builder for chaining.

setUriBytes(ByteString value)

public RecognitionAudio.Builder setUriBytes(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). For more information, see Request URIs.

string uri = 2;

Parameter
Name Description
value ByteString

The bytes for uri to set.

Returns
Type Description
RecognitionAudio.Builder

This builder for chaining.