Set the output bitrate
output_audio_bitrate sets the bitrate of compressed streaming audio. Lower values give smaller output, higher values give better quality.
The REST API does not define this parameter. REST requests that include it still succeed, but the field is ignored.
Example: HTTP streaming
The body of the response is the audio itself, so no base64 decoding is needed.
Example: WebSocket
WebSocket-only snippet using the Python SDK. Audio arrives as base64 in AudioOutput messages.
In the SDK, configure() takes target_language_code. On the raw wire, the config message field is language_code. send_completion_event="true" is a connection option (a query parameter) that makes the server send a final event when synthesis finishes.
What changes in the output
- For
mp3, a lower bitrate produces smaller chunks. In a test of the same short sentence over WebSocket,32kproduced roughly 2 KB chunks and192kroughly 10 KB chunks. - Use
64kfor speech where size matters, and128kor higher where fidelity matters.