Enum RecognitionConfig.AudioEncoding (4.23.0)

public enum RecognitionConfig.AudioEncoding extends Enum<RecognitionConfig.AudioEncoding> implements ProtocolMessageEnum

Audio encoding of the data sent in the audio message. All encodings support only 1 channel (mono) audio. Only FLAC includes a header that describes the bytes of audio that follow the header. The other encodings are raw audio bytes with no header. For best results, the audio source should be captured and transmitted using a lossless encoding (FLAC or LINEAR16). Recognition accuracy may be reduced if lossy codecs (such as AMR, AMR_WB and MULAW) are used to capture or transmit the audio, particularly if background noise is present.

Protobuf enum google.cloud.speech.v1beta1.RecognitionConfig.AudioEncoding

Implements

ProtocolMessageEnum

Static Fields

NameDescription
AMR

Adaptive Multi-Rate Narrowband codec. sample_rate must be 8000 Hz.

AMR = 4;

AMR_VALUE

Adaptive Multi-Rate Narrowband codec. sample_rate must be 8000 Hz.

AMR = 4;

AMR_WB

Adaptive Multi-Rate Wideband codec. sample_rate must be 16000 Hz.

AMR_WB = 5;

AMR_WB_VALUE

Adaptive Multi-Rate Wideband codec. sample_rate must be 16000 Hz.

AMR_WB = 5;

ENCODING_UNSPECIFIED

Not specified. Will return result google.rpc.Code.INVALID_ARGUMENT.

ENCODING_UNSPECIFIED = 0;

ENCODING_UNSPECIFIED_VALUE

Not specified. Will return result google.rpc.Code.INVALID_ARGUMENT.

ENCODING_UNSPECIFIED = 0;

FLAC

This is the recommended encoding for SyncRecognize and StreamingRecognize because it uses lossless compression; therefore recognition accuracy is not compromised by a lossy codec. The stream FLAC (Free Lossless Audio Codec) encoding is specified at: http://flac.sourceforge.net/documentation.html. 16-bit and 24-bit samples are supported. Not all fields in STREAMINFO are supported.

FLAC = 2;

FLAC_VALUE

This is the recommended encoding for SyncRecognize and StreamingRecognize because it uses lossless compression; therefore recognition accuracy is not compromised by a lossy codec. The stream FLAC (Free Lossless Audio Codec) encoding is specified at: http://flac.sourceforge.net/documentation.html. 16-bit and 24-bit samples are supported. Not all fields in STREAMINFO are supported.

FLAC = 2;

LINEAR16

Uncompressed 16-bit signed little-endian samples (Linear PCM). This is the only encoding that may be used by AsyncRecognize.

LINEAR16 = 1;

LINEAR16_VALUE

Uncompressed 16-bit signed little-endian samples (Linear PCM). This is the only encoding that may be used by AsyncRecognize.

LINEAR16 = 1;

MULAW

8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.

MULAW = 3;

MULAW_VALUE

8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.

MULAW = 3;

UNRECOGNIZED

Static Methods

NameDescription
forNumber(int value)
getDescriptor()
internalGetValueMap()
valueOf(Descriptors.EnumValueDescriptor desc)
valueOf(int value)

Deprecated. Use #forNumber(int) instead.

valueOf(String name)
values()

Methods

NameDescription
getDescriptorForType()
getNumber()
getValueDescriptor()