audio_format values on muga, mulberry and
mulberry-1.6: opus, pcm, mulaw, alaw, and mp3.
the field is optional. omit it entirely to preserve the original response:
post /v1/ttsreturns a 24 khz mono wav file.post /v1/tts/jsonreturns the same wav bytes inaudio_base64.- websocket sessions stream raw 24 khz mono signed 16-bit little-endian pcm.
supported values
wav and ogg are not accepted values. omit audio_format for wav, and use
opus for opus audio in an ogg container.
binary http response
addaudio_format to the json request body. the response body contains the
audio bytes directly, and the response content-type identifies the format.
curl
audio_format value and output extension to request another
format. leave the field out to receive speech.wav with the original behavior.
json base64 response
the json endpoint keeps the response object and replacesaudio_base64 with
the requested audio bytes encoded as base64.
python
request_id, audio_duration_ms, credits_used,
and usage_cost_nanos. the requested format does not change billing.
websocket streaming
setaudio_format when minting the one-shot session. do not add it to later
synthesis frames: the gateway stores the negotiated format in the session.
python
ws_url. the negotiated format applies at the
silk gateway. connecting to any other endpoint is outside this contract.
for opus and mp3, concatenate binary websocket messages in order before
decoding the complete stream. individual messages are not guaranteed to be
standalone audio files.