Guide

Text to Speech in Claude Code: Voice Lines for Your Project

Published By DreamClip

Text to speech in Claude Code works once the DreamClip connector is added: Claude Code reads your script file, sends each line to a speech model such as ElevenLabs v3, and saves the audio into your project with the file names your code expects. It suits game dialogue, app onboarding narration, tutorial voice-overs and spoken prompts for a phone menu, anything where dozens of lines have to match a list.

As of November 2026, Claude Code works in your terminal, reads the files in your project and runs commands you approve; it does not speak by itself. The connector adds three speech models with their voices, prices each line before it is read, and charges nothing for a line that fails. Voice cloning and changing an existing recording are not available through it.

Why do text to speech in Claude Code

A browser voice tool is fine for one line. A project needs forty, each tied to an id in a JSON or CSV file, saved under a predictable name, and redone whenever the writer changes a word. Claude Code can do the whole loop: parse the script, call the speech tool once per line, download each result, name it after its id, and update a manifest. When three lines change next week, it can redo only those three.

It also keeps the text and the audio in the same repository. The line that was read lives next to the file that reads it, so a reviewer can check the recording against the words.

Setting up the connector in the terminal

  1. Copy the claude mcp add command from the Claude Code panel of the connect page and run it. It registers https://dreamclip.ai/mcp at user scope, so it works in every folder, not just the one you are in.
  2. Start Claude Code and type /mcp.
  3. Select the dreamclip entry and its authenticate option; a browser tab asks for your DreamClip login, then for Allow.

There is no key to store in an environment file. Check the setup with a question that costs nothing, such as "what is my DreamClip balance?". A number back means the server is registered, the sign-in finished and both permissions were granted; a sentence asking you to connect again means the browser step did not complete.

The three speech models

Read from the DreamClip catalog when this page was built.
ModelMakerWhat it does
ElevenLabs v3MakerElevenLabsWhat it doesEleven v3, direction tags, 21 presets
MiniMax SpeechMakerMiniMaxWhat it doesSpeech-02 HD, expressive presets
VoiceoverMakerQwenWhat it doesNatural voiceover from text
From the catalog and the voice lists list_models returns, November 2026.
ModelLongest text a callVoices through the connector
ElevenLabs v3Longest text a call5,000 charactersVoices through the connector56: English presets plus native voices in seven more languages
MiniMax SpeechLongest text a call1,000 charactersVoices through the connector12 presets, labelled for 30+ languages
VoiceoverLongest text a call1,000 charactersVoices through the connectorNo voice list; the model's own voice

ElevenLabs v3 is the default when Claude Code names no model, and it is priced by length, per started block of 1,000 characters, so short lines and long paragraphs cost what their text weighs. Its native voices cover Spanish, French, German, Italian, Portuguese, Turkish and Hindi. Hear them first in the voice studio.

Choosing voices for characters

Ask Claude Code to call list_models with kind speech and print the voices as a table. Every entry lists its id together with the voice's name, gender, accent and language. Then make the casting a file in your repo, for example a voices.json mapping each character to a voice id, so every later run uses the same voices without being told again.

  • Give each speaking character one voice id and keep it for the life of the project.
  • Pick a native voice for lines in another language rather than an English preset reading them.
  • Keep the narrator distinct from the characters, a different gender or accent, so listeners can tell them apart.
  • Pass the language argument, in lower case, when a line is not in English.

A batch run from a script file

Suppose the game keeps its dialogue in a lines.json file, each entry with an id, a character and the text. A single request covers it: "For every entry in lines.json, read the text with the character's voice from voices.json on ElevenLabs v3, save each file to assets/voice/ named after the id, and write a manifest. Quote the whole batch first." Claude Code then:

  1. Reads both files and counts the lines and their characters.
  2. Calls estimate_cost per line with the text, adds the totals and shows you one figure against your balance.
  3. After you approve, calls generate_speech once per line with a fresh idempotency key each.
  4. Polls get_generation for each id until it is delivered.
  5. Downloads each file with a command you approve and writes the manifest.

Per account, the server allows 120 calls of any kind in a minute, of which at most 15 may start new runs. Free accounts render a single line at a time. For a big script, ask Claude Code to pace itself, or run the batch on a paid plan where several lines render together.

Writing lines that read well

Speech models read punctuation as timing. A comma is a short breath, a full stop a longer one, and an ellipsis a hesitation. Spell out numbers, units and abbreviations the way they should sound, since "10 km" may be read differently from "ten kilometres". ElevenLabs v3 also accepts direction tags in square brackets inside the text, such as "[whispers]" or "[sighs]" placed before the words they colour.

Examples of lines rewritten for speech.
Instead ofWrite
"Lvl 3 unlocked""Level three unlocked."
"Press OK""Press okay."
"v2.1 is live""Version two point one is live."

Claude Code can make this pass for you: "rewrite every line in lines.json for speech, spell out numbers, keep the meaning, show me the diff". You review the diff before any audio is made.

Narration for an app or a tutorial

Games are not the only use. An onboarding flow with a spoken welcome, a product tour with a narrated step per screen, or a course with a voice-over per lesson all follow the same pattern: the words live in the code or the content files, and the audio has to follow them. Point Claude Code at where the text lives and say how files should be named.

Example layouts; your project's names will differ.
ProjectWhere the text isWhat to ask for
OnboardingWhere the text isThe strings file for each stepWhat to ask forOne file per step, named after its key
Product tourWhere the text isA tour config with a caption per screenWhat to ask forNarration per caption, plus a total running time
CourseWhere the text isMarkdown lessonsWhat to ask forOne narration per lesson, split at headings
Phone menuWhere the text isA list of promptsWhat to ask forShort, slow reads in one calm voice

For a course, splitting at headings keeps every call well inside the character limit and makes a correction cheap: an edited paragraph is one short re-read, not the whole lesson. Ask Claude Code to report the duration of each delivered file if your player needs it, using whatever audio tool you have installed locally.

Redoing only what changed

Once the manifest records the text each file was read from, a rerun can compare the two. Ask: "re-read only the lines whose text no longer matches the manifest". Claude Code finds the edited entries, quotes them, and replaces just those files. Keep the manifest under version control and the history of every recording is in your commits.

If a call times out halfway through a batch, it is safe to send it again with the same idempotency key. The server answers with the first run rather than reading the line twice, so nothing is charged twice.

Costs and what is charged

  • Every line is quoted at the voice studio's price before it runs.
  • Credits are held when a line is queued and spent when the audio is delivered.
  • A line that fails or is cancelled returns its hold.
  • Set a ceiling per line and Claude Code passes max_credits; a line priced above it is refused.

Longer texts on ElevenLabs v3 cost more because the price follows characters. Splitting a long narration into paragraphs does not change the total much, but it does make retakes cheaper, because only the paragraph that needs fixing is read again.

What stays in the browser

Two voice tools need a recording, and the connector takes text and links rather than audio, so they are not available here: cloning a voice from a sample, and changing the voice of an existing recording. Use Voice Clone and Voice Changer in the studio for those, and read how to clone your voice with AI for the process. Lip sync for a talking head lives in the talking avatar tool.

Music and sound effects are reachable from the same connection, through generate_music. A game that needs footsteps and a menu theme alongside its dialogue can do all three from one Claude Code session.

Files, the library and disconnecting

Every line is also kept in your DreamClip library, and the links Claude Code downloads from keep working. Keep your own copies in the repository or your asset storage for shipping. To revoke access, choose Disconnect under Connected agents on your DreamClip account page. Removing the server from Claude Code alone leaves its sign-in able to refresh for up to 30 days. For the same tools in a chat window, see text to speech in Claude, and the text to speech page has samples of the voices.

Questions

Can Claude Code generate speech?

Yes, with the DreamClip connector added. It sends each line to a speech model and saves the audio it gets back.

Which voices can it use?

The ElevenLabs v3 and MiniMax Speech voices that list_models returns, each with an id, plus Voiceover's own voice.

How long can one line be?

It depends on the model: a single call to ElevenLabs v3 takes 5,000 characters, while the other two take a fifth of that.

Can it clone my voice?

Not from the terminal. A clone starts from a recording, and the speech tool accepts only text, so open Voice Clone in the browser for that.

Can it read lines in Spanish or Hindi?

Yes. Pick a native voice for that language and pass the language argument, for example spanish.

Can it read a whole script file in one go?

Yes, as a batch: one generate_speech call per line, quoted together first, paced to the account's limits, and each file saved under the name you choose.

Is a failed line charged?

No. Its held credits return to your balance.

Related