{
"type": "init",
"model": "deepgram/aura:2",
"voice": "asteria-en",
"config": {
"sample_rate": 24000,
"encoding": "linear16"
}
}{
"type": "text",
"text": "Hello, how can I help you?"
}{
"type": "flush"
}{
"type": "clear"
}{
"type": "cancel"
}{
"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"
}WebSocket protocol bridge using SLNG’s native protocol for TTS. Messages pass through directly using SLNG’s standard TTS message types (init, text, flush, clear, cancel, ready, audio_chunk, segment_start, segment_end, flushed, cleared, audio_end, error).
{
"type": "init",
"model": "deepgram/aura:2",
"voice": "asteria-en",
"config": {
"sample_rate": 24000,
"encoding": "linear16"
}
}{
"type": "text",
"text": "Hello, how can I help you?"
}{
"type": "flush"
}{
"type": "clear"
}{
"type": "cancel"
}{
"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
Initialize Unmute TTS session with model and voice.
Send text to synthesize.
Flush buffered audio.
Clear buffered audio.
Cancel TTS session.
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?