> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryhamsa.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate speech from a script

> Write or paste a script of up to 3,000 characters, read the length and credit estimate, check dictionary words, and generate with Cmd+Enter.

This page covers writing a script and turning it into speech: the length limit, the estimate of length and credits, the words your dictionaries will change, the paragraph view and drafts. It also covers sending text here from a transcript or an AI doc, and sending your script on to a voice over.

## Before you start

* Every member of the project can generate speech, whatever their role. The project must be active.
* The project owner's credit balance must be above zero. See [Credits](https://docs.tryhamsa.com/media/text-to-speech/overview.md#credits).

## Generate speech

**1. Open Text to speech**

Click **Text to speech** in the sidebar.

**2. Write the script**

Type or paste into the editor ("Start typing here or paste any text you want to turn into lifelike speech"). The counter under the script shows how many of the 3,000 characters you have used.

**3. Check the voice and settings**

The **Voice settings** tab shows the voice that will read the script, its **Expressiveness** and the **Dictionaries** that are on. See [Voice settings](https://docs.tryhamsa.com/media/text-to-speech/voice-settings.md).

**4. Check the estimate**

Beside the button, the estimate shows the expected length and cost, for example "about 1 min 40 s" over "about 4 credits".

![The editor footer with the counter 601/3000, the Paragraphs button, 7 changed words, and the estimate about 40 s, about 2 credits beside Generate speech](https://mintcdn.com/hamsa-452fa79a/etUfiFCo8p_6XpY_/images/media/text-to-speech/script-footer-estimate-light.webp?fit=max\&auto=format\&n=etUfiFCo8p_6XpY_\&q=85\&s=0e36833cf8366c813f053a11431d40e4)

**5. Generate**

Click **Generate speech**, or press Cmd+Enter (Ctrl+Enter on Windows). The button shows "Generating", and the audio starts playing in the player at the bottom of the page as it arrives. When it is done, "TTS job created successfully" confirms it and the take appears in [History](https://docs.tryhamsa.com/media/text-to-speech/history.md).

**Generate speech** stays disabled while the script is empty, while a generation is running, and while no voice is chosen. Cmd+Enter works from anywhere on the page except inside an open dialog or menu.

## Script length

A script can be up to 3,000 characters, spaces and line breaks included. The editor stops accepting text at 3,000, and the counter turns red. For longer text, generate it in parts.

The script needs at least one letter (Arabic or Latin) or digit. A script of only symbols or emoji is refused.

## The length and credit estimate

The estimate is worked out from the words in your script, before anything is generated. Hover over it to see the word count it used.

![The tooltip on the estimate: an estimate from the word count (46) at a typical reading pace, charged at 2 credits a minute of audio](https://mintcdn.com/hamsa-452fa79a/etUfiFCo8p_6XpY_/images/media/text-to-speech/estimate-tooltip-light.webp?fit=max\&auto=format\&n=etUfiFCo8p_6XpY_\&q=85\&s=bdcaefa44183bb5907281e27a1e4af2d)

| Part | How it is counted |
| - | - |
| Arabic words | 115 words a minute |
| English and other words | 155 words a minute |
| Numbers | One word for every two digits ("2026" counts as two), counted with the language that has more words in the script |
| Length shown | Whole seconds under 15 seconds, then rounded to the nearest 5 seconds |
| Credits shown | The length at 2 credits a minute, rounded up to a whole credit, at least 1 |

It is an estimate. The voice, punctuation and numbers change the real length, and you are charged for the real length of the audio. The estimate appears once the script has a letter or a number.

## Words your dictionaries change

When dictionaries are on for the script (see [Dictionaries](https://docs.tryhamsa.com/media/text-to-speech/voice-settings.md#dictionaries)), the words they will change are highlighted in the script. A bar under the script says how many, for example "4 changed words".

* Hover over a highlighted word, or move the cursor into it, to see "Read as:" and the reading. **Open in dictionary** opens that entry so you can change it.
* Click the bar to see the list, "Words your dictionaries change".
* **Hide highlights** beside the bar turns the marks off; **Show highlights** brings them back.

![The highlighted word Karama in the script with its card: Read as ka-ra-ma, from Newsroom names, and Open in dictionary](https://mintcdn.com/hamsa-452fa79a/etUfiFCo8p_6XpY_/images/media/text-to-speech/dictionary-word-read-as-light.webp?fit=max\&auto=format\&n=etUfiFCo8p_6XpY_\&q=85\&s=f953281d647ad655ae7f2048934dedb6)

![The list Words your dictionaries change, open above the 4 changed words bar: Deira, Karama, Jebel Ali and Sharjah with their readings](https://mintcdn.com/hamsa-452fa79a/etUfiFCo8p_6XpY_/images/media/text-to-speech/changed-words-list-light.webp?fit=max\&auto=format\&n=etUfiFCo8p_6XpY_\&q=85\&s=41411568588411e8ad08b1b79f26a3d9)

### Add a pronunciation from the script

**1. Select the word**

Select a word or phrase in the script (one line, up to 80 characters). An **Add pronunciation** button appears next to it. You can also run "Add pronunciation for “word”" from Cmd+K (Ctrl+K on Windows).

**2. Say how to read it**

In **Read as**, write how it should sound.

**3. Pick the dictionary**

Under **Dictionary**, pick one that is "On for this script", one of the "Other dictionaries", or **New dictionary** and give it a name. A dictionary that was off is turned on for this script.

![The Add pronunciation dialog for book fair, with Read as filled in and the Dictionary list open: On for this script, Other dictionaries and New dictionary](https://mintcdn.com/hamsa-452fa79a/etUfiFCo8p_6XpY_/images/media/text-to-speech/add-pronunciation-light.webp?fit=max\&auto=format\&n=etUfiFCo8p_6XpY_\&q=85\&s=fbe353fe08180db0952111418261091d)

**4. Save**

Click **Save**. "Saved to …" confirms it. If the word was already in that dictionary, the dialog says so first, and saving replaces its reading.

The entry is saved in the dictionary, so it applies wherever that dictionary is used. See [Dictionaries](https://docs.tryhamsa.com/media/voices/dictionaries.md).

## Paragraph view

For a script over 600 characters, a **Paragraphs** button appears in the footer. It shows the script one paragraph at a time, each with its own estimated length, and the total at the top ("4 paragraphs, about 2 min 10 s"). A paragraph is the text between line breaks.

Paragraph view is for reading only. Click a paragraph to go back to the editor with the cursor at its start. Click **Paragraphs** again to close it.

![Paragraph view of a five-paragraph script, each paragraph with its estimated length on the right, and 5 paragraphs, about 45 s at the top](https://mintcdn.com/hamsa-452fa79a/etUfiFCo8p_6XpY_/images/media/text-to-speech/paragraph-view-light.webp?fit=max\&auto=format\&n=etUfiFCo8p_6XpY_\&q=85\&s=51037003ecf093acb5bce190852dd088)

## Drafts

The script you are writing is saved in this browser as you type, one draft per project. Only the text is saved, not the voice or settings.

* When you come back to Text to speech and the editor is empty, the draft returns with "Draft restored". Click **Undo** to start from an empty script instead (this deletes the draft).
* The draft is cleared when a generation finishes.
* If you open a past job while you have unsaved text, Hamsa asks first ("Opening this job will discard your current text."). **Discard and open** drops the draft.
* A draft doesn't follow you to another browser or computer.

![The editor footer after coming back: the counter, Draft restored with Undo, and the estimate beside Generate speech](https://mintcdn.com/hamsa-452fa79a/etUfiFCo8p_6XpY_/images/media/text-to-speech/draft-restored-light.webp?fit=max\&auto=format\&n=etUfiFCo8p_6XpY_\&q=85\&s=4380471c82b6a689bb7e0fd18194d36d)

## Send text to text to speech

You can bring text in from other parts of Hamsa Media instead of pasting it.

| From | How | What is sent |
| - | - | - |
| A transcript | **Copy** menu, **Send to text to speech** | The whole transcript |
| A transcript | Select segments, then **Send to**, **Send to text to speech** | The selected segments |
| A transcript | A segment's menu, **Send to text to speech** | That segment |
| An AI doc | The speaker button at the top of the editor, **Read it aloud** | The document's text as it is on screen |

Text from a transcript arrives without times or speaker names, with each speaker's turn as its own paragraph. Line breaks are cleaned up: no more than one empty line in a row. From an AI doc with unsaved changes, Hamsa asks first ("Leave without saving?"); **Leave and read it aloud** sends the text and leaves the document.

Text to speech then opens with the text as the script and the default voice. Pick another voice before you generate if you need one.

### Text over 3,000 characters

If the text is too long, a dialog says so: "Too long for text to speech. This text has 4,210 characters. Text to speech takes up to 3,000 at a time."

* **Use the first 3,000 characters** sends the start of the text. The cut falls on the last space or line break near the end, so a word isn't split.
* **Send the selection instead** appears when you sent a whole transcript with segments selected, and the selection fits.
* **Cancel** sends nothing.

### When you already have a draft

If Text to speech has a different script you were writing, Hamsa asks before replacing it: "Replace your text to speech script?". **Keep my script** cancels; **Replace it** sends the text. After it arrives, "Replaced your earlier draft" with **Undo** lets you get your draft back, until you start editing.

## Use your script in a voice over

Click **Use in a voice over** in the page header (or run "Use the script in a voice over" from Cmd+K) to open a new voice over with your script in **My script** mode. A voice over script takes up to 1,000 characters; a longer script gets the same kind of dialog, with **Use the first 1,000 characters**. See [Create a voice over](https://docs.tryhamsa.com/media/voice-overs/create-a-voice-over.md).

The button shows when the script has text and the project is active.

![The Text to speech header with 2 credits/minute and the Use in a voice over button](https://mintcdn.com/hamsa-452fa79a/etUfiFCo8p_6XpY_/images/media/text-to-speech/use-in-voice-over-light.webp?fit=max\&auto=format\&n=etUfiFCo8p_6XpY_\&q=85\&s=11e651c55a8a4a99effaf79f1d6386d0)

## Good to know

* Characters count everything in the field, so spaces and line breaks use up the 3,000 too.
* If the balance runs out, Hamsa refuses the generation; the Owner adds credits in [Billing](https://docs.tryhamsa.com/overview/billing.md).
* If a generation fails, an error message explains why, and your script stays in the editor. Nothing is added to History.
* Switching to another project with unsaved text asks first. Discarding there deletes the draft.

## Related

> [card] [Voice settings](https://docs.tryhamsa.com/media/text-to-speech/voice-settings.md)
>
> Choose the voice, expressiveness and dictionaries.

> [card] [History](https://docs.tryhamsa.com/media/text-to-speech/history.md)
>
> Play, compare, download and remix takes.

> [card] [Dictionaries](https://docs.tryhamsa.com/media/voices/dictionaries.md)
>
> Manage pronunciation entries.

> [card] [Transcript editor](https://docs.tryhamsa.com/media/speech-to-text/transcript-editor.md)
>
> Select segments and send them here.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.