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

# Audiobook generation

Audiobook workflows benefit from repeatable naming, stable voice settings, and chapter-level files. The CLI gives an agent a simple command surface for generating drafts, rerendering chapters, and keeping approved audio separate.

## Prepare defaults

Set the voice and model once before generating chapters:

```bash
cast config set voice-id tc_xxx
cast config set model ssfm-v30
cast config set format mp3
```

If you need a project-specific voice, clone it first and store the returned `uc_` voice ID:

```bash
cast voices clone narrator-sample.wav --name "Narrator Draft"
cast config set voice-id uc_xxx
```

## Generate chapters

```bash
cast "$(cat chapter-01.txt)" \
  --emotion smart \
  --out audiobook/chapter-01.mp3 \
  --format mp3

cast "$(cat chapter-02.txt)" \
  --emotion smart \
  --out audiobook/chapter-02.mp3 \
  --format mp3
```

## Generate captions or review timing

```bash
cast "$(cat chapter-01.txt)" \
  --emotion smart \
  --out audiobook/chapter-01.wav \
  --timestamp-out audiobook/chapter-01.timestamps.json
```

Use JSON for detailed review timing, or write `.srt` / `.vtt` when the audiobook content also needs a video preview.

## Use emotion for scene changes

For short passages with a known tone, preset emotion can be more controllable than smart emotion:

```bash
cast "The room fell silent as the letter slipped from her hand." \
  --emotion preset \
  --emotion-preset sad \
  --emotion-intensity 1.2 \
  --out audiobook/scene-letter.mp3
```

For passages where surrounding context matters, pass neighboring text:

```bash
cast "She opened the door and froze." \
  --emotion smart \
  --prev-text "The hallway had been empty a moment ago." \
  --next-text "A familiar voice whispered her name." \
  --out audiobook/scene-door.mp3
```

## Agent prompt pattern

```text
Generate audiobook draft files from the chapter text files.
Use the same voice for every chapter.
Write output to ./audiobook.
Use one MP3 per chapter.
For chapters that also need video previews, generate an SRT file next to the audio.
If a chapter fails, report the filename and keep going.
```

## File naming

| Asset | Suggested filename |
|-------|--------------------|
| Full chapter | `chapter-01.mp3` |
| Scene revision | `chapter-01-scene-03-v2.mp3` |
| Approved final | `chapter-01-final.mp3` |
| Alternate delivery | `chapter-01-alt-happy.mp3` |

## When to use advanced features

| Need | Recommended feature |
|------|---------------------|
| Consistent narrator identity | `cast config set voice-id ...` |
| Temporary narrator matching a sample | `cast voices clone narrator-sample.wav --name "Narrator Draft"` |
| Chapter review timing | `--timestamp-out chapter-01.timestamps.json` |
| Video preview for a chapter | `--timestamp-out chapter-01.srt` |
| Quick approval playback | `cast "one review sentence"` without `--out` |

<Warning>
  Avoid overwriting approved audio. Ask the agent to write revisions with `-v2`, `-v3`, or a delivery label.
</Warning>
