class RecognitionConfig_AudioEncoding

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

Constants

ENCODING_UNSPECIFIED

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

Generated from protobuf enum ENCODING_UNSPECIFIED = 0;

LINEAR16

Uncompressed 16-bit signed little-endian samples (Linear PCM).

This is the only encoding that may be used by AsyncRecognize.

Generated from protobuf enum LINEAR16 = 1;

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.

Generated from protobuf enum FLAC = 2;

MULAW

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

Generated from protobuf enum MULAW = 3;

AMR

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

Generated from protobuf enum AMR = 4;

AMR_WB

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

Generated from protobuf enum AMR_WB = 5;