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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-03-30 UTC."],[],[]]