{
"type": "init",
"voice": "aura-2-thalia-en",
"config": {
"sample_rate": 24000,
"encoding": "linear16"
}
}{
"type": "text",
"text": "Hello, how can I help you?"
}{
"type": "flush"
}{
"type": "clear"
}{
"type": "close"
}{
"type": "keepalive"
}{
"type": "ready",
"session_id": "sess_tts_abc123"
}{
"type": "audio_chunk",
"data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEA...",
"sequence": 1
}{
"type": "segment_start",
"segment_id": "seg_001"
}{
"type": "segment_end",
"segment_id": "seg_001"
}{
"type": "flushed"
}{
"type": "cleared"
}{
"type": "audio_end",
"duration": 3.5
}{
"type": "error",
"code": "provider_error",
"message": "Upstream service unavailable"
}Unified TTS
Stream synthesized audio from any SLNG-supported TTS model over the unified WebSocket protocol with init, text, flush, clear, and audio chunk messages.
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",
"voice": "aura-2-thalia-en",
"config": {
"sample_rate": 24000,
"encoding": "linear16"
}
}{
"type": "text",
"text": "Hello, how can I help you?"
}{
"type": "flush"
}{
"type": "clear"
}{
"type": "close"
}{
"type": "keepalive"
}{
"type": "ready",
"session_id": "sess_tts_abc123"
}{
"type": "audio_chunk",
"data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEA...",
"sequence": 1
}{
"type": "segment_start",
"segment_id": "seg_001"
}{
"type": "segment_end",
"segment_id": "seg_001"
}{
"type": "flushed"
}{
"type": "cleared"
}{
"type": "audio_end",
"duration": 3.5
}{
"type": "error",
"code": "provider_error",
"message": "Upstream service unavailable"
}API key issued by SLNG. Pass as Authorization: Bearer <token> in the WebSocket upgrade request headers.
GET
Target region override. Auto-selected if not provided.
Target world part override. Auto-selected if not provided.
Target region override as a query parameter. Auto-selected if not provided. Equivalent to the X-Region-Override header; the header takes precedence when both are set.
ap-southeast-2, eu-north-1, us-east-1Target world part override as a query parameter. Auto-selected if not provided. Equivalent to the X-World-Part-Override header; the header takes precedence when both are set.
ap, eu, naInitialize Unmute TTS session with voice and configuration.
Send text to synthesize.
Flush buffered audio.
Clear buffered audio.
Close TTS session.
Keep the WebSocket connection alive during silence.
Unmute TTS session is ready.
Audio chunk from Unmute TTS synthesis.
Start of a new synthesis segment.
End of a synthesis segment.
All buffered audio has been flushed.
Buffered audio has been cleared.
All audio for the current synthesis has been sent.
Error occurred during Unmute TTS session.
Was this page helpful?