{
"type": "init",
"stream_id": "stream-1",
"model": "tts-rt-v1",
"language": "en",
"voice": "Adrian",
"audio_format": "wav",
"sample_rate": 24000
}{
"type": "text",
"stream_id": "stream-1",
"text": "Hello from Soniox text-to-speech.",
"text_end": false
}{
"type": "clear",
"stream_id": "stream-1",
"cancel": true
}{
"type": "audio_chunk",
"audio": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAAAAA=",
"audio_end": false,
"stream_id": "stream-1"
}{
"type": "terminated",
"terminated": true,
"stream_id": "stream-1"
}{
"type": "error",
"error_code": 400,
"error_message": "Missing required field: model",
"stream_id": "stream-1"
}Real-time text-to-speech with streaming WebSocket and one-shot HTTP synthesis
Documentation Index
Fetch the complete documentation index at: https://docs.slng.ai/llms.txt
Use this file to discover all available pages before exploring further.
{
"type": "init",
"stream_id": "stream-1",
"model": "tts-rt-v1",
"language": "en",
"voice": "Adrian",
"audio_format": "wav",
"sample_rate": 24000
}{
"type": "text",
"stream_id": "stream-1",
"text": "Hello from Soniox text-to-speech.",
"text_end": false
}{
"type": "clear",
"stream_id": "stream-1",
"cancel": true
}{
"type": "audio_chunk",
"audio": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAAAAA=",
"audio_end": false,
"stream_id": "stream-1"
}{
"type": "terminated",
"terminated": true,
"stream_id": "stream-1"
}{
"type": "error",
"error_code": 400,
"error_message": "Missing required field: model",
"stream_id": "stream-1"
}GET
Override target world part. Auto-selected if not provided.
naInitialize a TTS stream. Sent once per stream_id before any text frames.
Stream text incrementally to the active stream. Set text_end true on the final chunk.
Cancel an in-flight stream. Server stops audio and terminates the stream.
Audio bytes for the stream chunk. audio_end true marks the final audio payload (stream not yet terminated).
Server has fully closed the stream and released resources. stream_id may now be reused.
An error encountered on the stream. After an error the stream is typically terminated.
Was this page helpful?