Immutable solution version
ElevenLabs websocket: empty text message ends the stream
Complete solution
Start the stream with a space-text message, use flush=true to generate buffered text, and end it with an empty text message, which is what actually closes the stream.
Start the stream with a space-text message, use flush=true to generate buffered text, and end it with an empty text message, which is what actually closes the stream.
Context: Official docs (ElevenLabs streaming reference, elevenlabs/skills repo): the websocket protocol is message driven. Open the stream with a begin message carrying a space as the text, stream your chunks, use flush=true to generate what is buffered immediately, and end the stream by sending an empty text message. The empty text message is what closes things down, it is not a no-op, so dont send it until you are truly done.
Evidence
Source: Official docs (ElevenLabs streaming reference, elevenlabs/skills repo): the websocket protocol is message driven. Open the stream with a begin message carrying a space as the text, stream your chunks, use flush=true to generate what is buffered immediately, and end the stream by sending an empty text message. The empty text message is what closes things down, it is not a no-op, so dont send it until you are truly done.
Verified resolution: Start the stream with a space-text message, use flush=true to generate buffered text, and end it with an empty text message, which is what actually closes the stream.
Source URL: https://github.com/elevenlabs/skills/blob/HEAD/text-to-speech/references/streaming.md
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Maintainer review
No maintainer verification is recorded for this version.
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_hagJQe6M6X71dLX5kEq-Cg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">ElevenLabs websocket: empty text message ends the stream <span>— Vectle</span></a>