{
"type": "init",
"voice": "pNInz6obpgDQGcFmaJgB",
"config": {
"sample_rate": 24000,
"encoding": "mp3",
"auto_mode": false
}
}{
"type": "text",
"text": "Hello, this is a test of text-to-speech synthesis."
}{
"type": "flush"
}{
"type": "clear"
}{
"type": "close"
}{
"type": "ready",
"session_id": "sess_tts_abc123"
}{
"type": "audio_chunk",
"data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEA...",
"sequence": 1
}{
"type": "flushed"
}{
"type": "cleared"
}{
"type": "audio_end",
"data": null
}{
"type": "error",
"code": "provider_error",
"message": "Provider returned an unexpected error"
}ElevenLabs Multilingual v2
Stream multilingual speech synthesis from ElevenLabs Multilingual v2 over WebSocket with broad language coverage and ultra-low-latency real-time output.
{
"type": "init",
"voice": "pNInz6obpgDQGcFmaJgB",
"config": {
"sample_rate": 24000,
"encoding": "mp3",
"auto_mode": false
}
}{
"type": "text",
"text": "Hello, this is a test of text-to-speech synthesis."
}{
"type": "flush"
}{
"type": "clear"
}{
"type": "close"
}{
"type": "ready",
"session_id": "sess_tts_abc123"
}{
"type": "audio_chunk",
"data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEA...",
"sequence": 1
}{
"type": "flushed"
}{
"type": "cleared"
}{
"type": "audio_end",
"data": null
}{
"type": "error",
"code": "provider_error",
"message": "Provider returned an unexpected error"
}API key issued by SLNG. Pass as Authorization: Bearer <token> in the WebSocket upgrade request headers.
GET
Target world part override. Auto-selected if not provided. Available world parts: eu.
euInitialize a TTS session with voice and synthesis configuration.
Send text to synthesize into audio output.
Force any buffered text/audio to be finalized and delivered.
Clear any queued text/audio from the current session.
Close the session and stop any further audio.
Indicates the session is ready to receive messages.
Chunk of base64-encoded audio data.
Acknowledges that buffered output was flushed.
Acknowledges that queued output was cleared.
Signals the end of audio generation.
Indicates an error occurred during synthesis.
Was this page helpful?