- 4.50.0 (latest)
- 4.49.0
- 4.48.0
- 4.47.0
- 4.46.0
- 4.44.0
- 4.43.0
- 4.42.0
- 4.41.0
- 4.40.0
- 4.39.0
- 4.38.0
- 4.37.0
- 4.36.0
- 4.35.0
- 4.34.0
- 4.32.0
- 4.31.0
- 4.30.0
- 4.29.0
- 4.28.0
- 4.27.0
- 4.26.0
- 4.25.0
- 4.24.0
- 4.23.0
- 4.22.0
- 4.19.0
- 4.18.0
- 4.17.0
- 4.16.0
- 4.15.0
- 4.14.0
- 4.13.0
- 4.12.0
- 4.11.0
- 4.10.0
- 4.9.0
- 4.8.0
- 4.7.0
- 4.6.0
- 4.4.0
- 4.3.0
- 4.2.0
- 4.1.0
- 4.0.0
- 3.0.0
- 2.6.1
- 2.5.9
- 2.4.0
- 2.3.0
- 2.2.15
public enum RecognitionConfig.AudioEncoding extends Enum<RecognitionConfig.AudioEncoding> implements ProtocolMessageEnum
The encoding of the audio data sent in the request.
All encodings support only 1 channel (mono) audio, unless the
audio_channel_count
and enable_separate_recognition_per_channel
fields
are set.
For best results, the audio source should be captured and transmitted using
a lossless encoding (FLAC
or LINEAR16
). The accuracy of the speech
recognition can be reduced if lossy codecs are used to capture or transmit
audio, particularly if background noise is present. Lossy codecs include
MULAW
, AMR
, AMR_WB
, OGG_OPUS
, SPEEX_WITH_HEADER_BYTE
, MP3
,
and WEBM_OPUS
.
The FLAC
and WAV
audio file formats include a header that describes the
included audio content. You can request recognition for WAV
files that
contain either LINEAR16
or MULAW
encoded audio.
If you send FLAC
or WAV
audio file format in
your request, you do not need to specify an AudioEncoding
; the audio
encoding format is determined from the file header. If you specify
an AudioEncoding
when you send send FLAC
or WAV
audio, the
encoding configuration must match the encoding described in the audio
header; otherwise the request returns an
google.rpc.Code.INVALID_ARGUMENT error
code.
Protobuf enum google.cloud.speech.v1.RecognitionConfig.AudioEncoding
Implements
ProtocolMessageEnumStatic Fields
Name | Description |
AMR | Adaptive Multi-Rate Narrowband codec. |
AMR_VALUE | Adaptive Multi-Rate Narrowband codec. |
AMR_WB | Adaptive Multi-Rate Wideband codec. |
AMR_WB_VALUE | Adaptive Multi-Rate Wideband codec. |
ENCODING_UNSPECIFIED | Not specified. |
ENCODING_UNSPECIFIED_VALUE | Not specified. |
FLAC | |
FLAC_VALUE | |
LINEAR16 | Uncompressed 16-bit signed little-endian samples (Linear PCM). |
LINEAR16_VALUE | Uncompressed 16-bit signed little-endian samples (Linear PCM). |
MULAW | 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. |
MULAW_VALUE | 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. |
OGG_OPUS | Opus encoded audio frames in Ogg container
(OggOpus).
|
OGG_OPUS_VALUE | Opus encoded audio frames in Ogg container
(OggOpus).
|
SPEEX_WITH_HEADER_BYTE | Although the use of lossy encodings is not recommended, if a very low
bitrate encoding is required, |
SPEEX_WITH_HEADER_BYTE_VALUE | Although the use of lossy encodings is not recommended, if a very low
bitrate encoding is required, |
UNRECOGNIZED | |
WEBM_OPUS | Opus encoded audio frames in WebM container
(OggOpus). |
WEBM_OPUS_VALUE | Opus encoded audio frames in WebM container
(OggOpus). |
Static Methods
Name | Description |
forNumber(int value) | |
getDescriptor() | |
internalGetValueMap() | |
valueOf(Descriptors.EnumValueDescriptor desc) | |
valueOf(int value) | Deprecated. Use #forNumber(int) instead. |
valueOf(String name) | |
values() |
Methods
Name | Description |
getDescriptorForType() | |
getNumber() | |
getValueDescriptor() |