Adjust the loudness
The loudness parameter scales the volume of the generated audio. Values below 1.0 make it quieter and values above 1.0 make it louder.
Example
WebSocket example
loudness is set in the configure message and applies to every convert call that follows. The Python SDK names the language argument target_language_code; it is sent as language_code.
What changes in the output
The waveform amplitude scales with the value. In a short test, 0.1 produced audio at roughly a tenth of the default peak level, while 2.0 and 2.5 reached full scale, so very high values can clip.
If you need more volume, raise it in small steps and check for distortion, or normalize the audio in your player or pipeline instead.
Common errors
Out-of-range values are rejected with HTTP 400 on REST. On WebSocket, the error arrives as a JSON message with code 422 or 400 instead.
On WebSocket, send a new configure message to change loudness mid-session. Text still in the buffer is flushed first, then the new settings apply.