Set the sample rate
speech_sample_rate sets the sample rate of the generated audio in Hz. Higher rates give more audio bandwidth and larger output.
Example
For streaming, set speech_sample_rate in the HTTP stream request body or in the WebSocket config message (as a string, for example "speech_sample_rate": "16000"). See WebSocket TTS.
What changes in the output
- The sample rate of the returned audio matches the value you send, in every codec that carries a sample rate (for example the WAV header).
- Lower rates (
8000) give smaller files and suit telephony. Higher rates (24000and above) preserve more detail. - Omitting the field returns
22050Hz.