Protobuf type google.cloud.dialogflow.v2.AudioEncoding
Namespace
Google \ Cloud \ Dialogflow \ V2
Methods
static::name
Parameter
Name
Description
value
mixed
static::value
Parameter
Name
Description
name
mixed
Constants
AUDIO_ENCODING_UNSPECIFIED
Value: 0
Not specified.
Generated from protobuf enum AUDIO_ENCODING_UNSPECIFIED = 0;
AUDIO_ENCODING_LINEAR_16
Value: 1
Uncompressed 16-bit signed little-endian samples (Linear PCM).
Generated from protobuf enum AUDIO_ENCODING_LINEAR_16 = 1;
AUDIO_ENCODING_FLAC
Value: 2
FLAC (Free Lossless Audio
Codec) is the recommended encoding because it is lossless (therefore
recognition is not compromised) and requires only about half the
bandwidth of LINEAR16. FLAC stream encoding supports 16-bit and
24-bit samples, however, not all fields in STREAMINFO are supported.
Generated from protobuf enum AUDIO_ENCODING_FLAC = 2;
AUDIO_ENCODING_MULAW
Value: 3
8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
Generated from protobuf enum AUDIO_ENCODING_MULAW = 3;
AUDIO_ENCODING_AMR
Value: 4
Adaptive Multi-Rate Narrowband codec. sample_rate_hertz must be 8000.
Generated from protobuf enum AUDIO_ENCODING_AMR = 4;
AUDIO_ENCODING_AMR_WB
Value: 5
Adaptive Multi-Rate Wideband codec. sample_rate_hertz must be 16000.
Generated from protobuf enum AUDIO_ENCODING_AMR_WB = 5;
AUDIO_ENCODING_OGG_OPUS
Value: 6
Opus encoded audio frames in Ogg container
(OggOpus).
sample_rate_hertz must be 16000.
Generated from protobuf enum AUDIO_ENCODING_OGG_OPUS = 6;
AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE
Value: 7
Although the use of lossy encodings is not recommended, if a very low
bitrate encoding is required, OGG_OPUS is highly preferred over
Speex encoding. The Speex encoding supported by
Dialogflow API has a header byte in each block, as in MIME type
audio/x-speex-with-header-byte.
It is a variant of the RTP Speex encoding defined in
RFC 5574.
The stream is a sequence of blocks, one block per RTP packet. Each block
starts with a byte containing the length of the block, in bytes, followed
by one or more frames of Speex data, padded to an integral number of
bytes (octets) as specified in RFC 5574. In other words, each RTP header
is replaced with a single byte containing the block length. Only Speex
wideband is supported. sample_rate_hertz must be 16000.
Generated from protobuf enum AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;
AUDIO_ENCODING_ALAW
Value: 8
8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law.
Generated from protobuf enum AUDIO_ENCODING_ALAW = 8;
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Dialogflow V2 Client - Class AudioEncoding (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-dialogflow/latest/V2.AudioEncoding)\n- [2.1.1](/php/docs/reference/cloud-dialogflow/2.1.1/V2.AudioEncoding)\n- [2.0.1](/php/docs/reference/cloud-dialogflow/2.0.1/V2.AudioEncoding)\n- [1.17.2](/php/docs/reference/cloud-dialogflow/1.17.2/V2.AudioEncoding)\n- [1.16.0](/php/docs/reference/cloud-dialogflow/1.16.0/V2.AudioEncoding)\n- [1.15.1](/php/docs/reference/cloud-dialogflow/1.15.1/V2.AudioEncoding)\n- [1.14.0](/php/docs/reference/cloud-dialogflow/1.14.0/V2.AudioEncoding)\n- [1.13.0](/php/docs/reference/cloud-dialogflow/1.13.0/V2.AudioEncoding)\n- [1.12.3](/php/docs/reference/cloud-dialogflow/1.12.3/V2.AudioEncoding)\n- [1.11.0](/php/docs/reference/cloud-dialogflow/1.11.0/V2.AudioEncoding)\n- [1.10.2](/php/docs/reference/cloud-dialogflow/1.10.2/V2.AudioEncoding)\n- [1.9.0](/php/docs/reference/cloud-dialogflow/1.9.0/V2.AudioEncoding)\n- [1.8.0](/php/docs/reference/cloud-dialogflow/1.8.0/V2.AudioEncoding)\n- [1.7.2](/php/docs/reference/cloud-dialogflow/1.7.2/V2.AudioEncoding)\n- [1.6.0](/php/docs/reference/cloud-dialogflow/1.6.0/V2.AudioEncoding)\n- [1.5.0](/php/docs/reference/cloud-dialogflow/1.5.0/V2.AudioEncoding)\n- [1.4.0](/php/docs/reference/cloud-dialogflow/1.4.0/V2.AudioEncoding)\n- [1.3.2](/php/docs/reference/cloud-dialogflow/1.3.2/V2.AudioEncoding)\n- [1.2.0](/php/docs/reference/cloud-dialogflow/1.2.0/V2.AudioEncoding)\n- [1.1.1](/php/docs/reference/cloud-dialogflow/1.1.1/V2.AudioEncoding)\n- [1.0.1](/php/docs/reference/cloud-dialogflow/1.0.1/V2.AudioEncoding) \nReference documentation and code samples for the Google Cloud Dialogflow V2 Client class AudioEncoding.\n\nAudio encoding of the audio content sent in the conversational query request.\n\nRefer to the\n[Cloud Speech API\ndocumentation](https://cloud.google.com/speech-to-text/docs/basics) for more\ndetails.\n\nProtobuf type `google.cloud.dialogflow.v2.AudioEncoding`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dialogflow \\\\ V2\n\nMethods\n-------\n\n### static::name\n\n### static::value\n\nConstants\n---------\n\n### AUDIO_ENCODING_UNSPECIFIED\n\n Value: 0\n\nNot specified.\n\nGenerated from protobuf enum `AUDIO_ENCODING_UNSPECIFIED = 0;`\n\n### AUDIO_ENCODING_LINEAR_16\n\n Value: 1\n\nUncompressed 16-bit signed little-endian samples (Linear PCM).\n\nGenerated from protobuf enum `AUDIO_ENCODING_LINEAR_16 = 1;`\n\n### AUDIO_ENCODING_FLAC\n\n Value: 2\n\n[`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio\nCodec) is the recommended encoding because it is lossless (therefore\nrecognition is not compromised) and requires only about half the\nbandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and\n24-bit samples, however, not all fields in `STREAMINFO` are supported.\n\nGenerated from protobuf enum `AUDIO_ENCODING_FLAC = 2;`\n\n### AUDIO_ENCODING_MULAW\n\n Value: 3\n\n8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.\n\nGenerated from protobuf enum `AUDIO_ENCODING_MULAW = 3;`\n\n### AUDIO_ENCODING_AMR\n\n Value: 4\n\nAdaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.\n\nGenerated from protobuf enum `AUDIO_ENCODING_AMR = 4;`\n\n### AUDIO_ENCODING_AMR_WB\n\n Value: 5\n\nAdaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.\n\nGenerated from protobuf enum `AUDIO_ENCODING_AMR_WB = 5;`\n\n### AUDIO_ENCODING_OGG_OPUS\n\n Value: 6\n\nOpus encoded audio frames in Ogg container\n([OggOpus](https://wiki.xiph.org/OggOpus)).\n\n`sample_rate_hertz` must be 16000.\n\nGenerated from protobuf enum `AUDIO_ENCODING_OGG_OPUS = 6;`\n\n### AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE\n\n Value: 7\n\nAlthough the use of lossy encodings is not recommended, if a very low\nbitrate encoding is required, `OGG_OPUS` is highly preferred over\nSpeex encoding. The [Speex](https://speex.org/) encoding supported by\nDialogflow API has a header byte in each block, as in MIME type\n`audio/x-speex-with-header-byte`.\n\nIt is a variant of the RTP Speex encoding defined in\n[RFC 5574](https://tools.ietf.org/html/rfc5574).\nThe stream is a sequence of blocks, one block per RTP packet. Each block\nstarts with a byte containing the length of the block, in bytes, followed\nby one or more frames of Speex data, padded to an integral number of\nbytes (octets) as specified in RFC 5574. In other words, each RTP header\nis replaced with a single byte containing the block length. Only Speex\nwideband is supported. `sample_rate_hertz` must be 16000.\n\nGenerated from protobuf enum `AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;`\n\n### AUDIO_ENCODING_ALAW\n\n Value: 8\n\n8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law.\n\nGenerated from protobuf enum `AUDIO_ENCODING_ALAW = 8;`"]]