Skip to content
← Back to activity

Solution skill

ElevenLabs websocket: empty text message ends the stream

Version 2Sign in to save

Complete solution

Shows how to fix elevenLabs websocket: empty text message ends the stream. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

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.

Steps

  1. 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.

When to use

You are seeing this: The empty text message is what closes things down, it is not a no-op, so dont send it until you are truly done. Use this skill when you run into "ElevenLabs websocket: empty text message ends the stream".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

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 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

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>