Generated from protobuf enum AUDIO_ENCODING_UNSPECIFIED = 0;
LINEAR16
Value: 1
Uncompressed 16-bit signed little-endian samples (Linear PCM).
Audio content returned as LINEAR16 also contains a WAV header.
Generated from protobuf enum LINEAR16 = 1;
MP3
Value: 2
MP3 audio at 32kbps.
Generated from protobuf enum MP3 = 2;
OGG_OPUS
Value: 3
Opus encoded audio wrapped in an ogg container. The result is a
file which can be played natively on Android, and in browsers (at least
Chrome and Firefox). The quality of the encoding is considerably higher
than MP3 while using approximately the same bitrate.
Generated from protobuf enum OGG_OPUS = 3;
MULAW
Value: 5
8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
Audio content returned as MULAW also contains a WAV header.
Generated from protobuf enum MULAW = 5;
ALAW
Value: 6
8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law.
Audio content returned as ALAW also contains a WAV header.
Generated from protobuf enum ALAW = 6;
PCM
Value: 7
Uncompressed 16-bit signed little-endian samples (Linear PCM).
Note that as opposed to LINEAR16, audio won't be wrapped in a WAV (or
any other) header.
[[["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-09 UTC."],[],[],null,["# Cloud Text-to-Speech V1 Client - Class AudioEncoding (2.2.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.2.2 (latest)](/php/docs/reference/cloud-text-to-speech/latest/V1.AudioEncoding)\n- [2.2.1](/php/docs/reference/cloud-text-to-speech/2.2.1/V1.AudioEncoding)\n- [2.0.1](/php/docs/reference/cloud-text-to-speech/2.0.1/V1.AudioEncoding)\n- [1.12.2](/php/docs/reference/cloud-text-to-speech/1.12.2/V1.AudioEncoding)\n- [1.11.0](/php/docs/reference/cloud-text-to-speech/1.11.0/V1.AudioEncoding)\n- [1.10.0](/php/docs/reference/cloud-text-to-speech/1.10.0/V1.AudioEncoding)\n- [1.9.1](/php/docs/reference/cloud-text-to-speech/1.9.1/V1.AudioEncoding)\n- [1.8.5](/php/docs/reference/cloud-text-to-speech/1.8.5/V1.AudioEncoding)\n- [1.7.2](/php/docs/reference/cloud-text-to-speech/1.7.2/V1.AudioEncoding)\n- [1.6.1](/php/docs/reference/cloud-text-to-speech/1.6.1/V1.AudioEncoding)\n- [1.5.6](/php/docs/reference/cloud-text-to-speech/1.5.6/V1.AudioEncoding)\n- [1.4.5](/php/docs/reference/cloud-text-to-speech/1.4.5/V1.AudioEncoding) \nReference documentation and code samples for the Cloud Text-to-Speech V1 Client class AudioEncoding.\n\nConfiguration to set up audio encoder. The encoding determines the output\naudio format that we'd like.\n\nProtobuf type `google.cloud.texttospeech.v1.AudioEncoding`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ TextToSpeech \\\\ V1\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. Will return result\n[google.rpc.Code.INVALID_ARGUMENT](https://cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__INVALID_ARGUMENT).\n\nGenerated from protobuf enum `AUDIO_ENCODING_UNSPECIFIED = 0;`\n\n### LINEAR16\n\n Value: 1\n\nUncompressed 16-bit signed little-endian samples (Linear PCM).\n\nAudio content returned as LINEAR16 also contains a WAV header.\n\nGenerated from protobuf enum `LINEAR16 = 1;`\n\n### MP3\n\n Value: 2\n\nMP3 audio at 32kbps.\n\nGenerated from protobuf enum `MP3 = 2;`\n\n### OGG_OPUS\n\n Value: 3\n\nOpus encoded audio wrapped in an ogg container. The result is a\nfile which can be played natively on Android, and in browsers (at least\nChrome and Firefox). The quality of the encoding is considerably higher\nthan MP3 while using approximately the same bitrate.\n\nGenerated from protobuf enum `OGG_OPUS = 3;`\n\n### MULAW\n\n Value: 5\n\n8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.\n\nAudio content returned as MULAW also contains a WAV header.\n\nGenerated from protobuf enum `MULAW = 5;`\n\n### ALAW\n\n Value: 6\n\n8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law.\n\nAudio content returned as ALAW also contains a WAV header.\n\nGenerated from protobuf enum `ALAW = 6;`\n\n### PCM\n\n Value: 7\n\nUncompressed 16-bit signed little-endian samples (Linear PCM).\n\nNote that as opposed to LINEAR16, audio won't be wrapped in a WAV (or\nany other) header.\n\nGenerated from protobuf enum `PCM = 7;`"]]