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

# Synthesis

## Feature map

| Need | Use |
|------|-----|
| Immediate local playback | `cast "text"` |
| Reusable audio file | `--out file.wav` or `--out file.mp3 --format mp3` |
| Realtime-feeling agent response | Default playback without `--out` |
| Timestamp JSON | `--timestamp-out file.json` |
| SRT or WebVTT subtitles | `--timestamp-out file.srt` or `--timestamp-out file.vtt` |
| Custom cloned voice | `--voice-id uc_xxx` after `cast voices clone` |

## Basic usage

```bash
# Play immediately
cast "Hello, world!"

# Use a specific voice
cast "Hello, world!" --voice-id tc_xxx

# Save to WAV file
cast "Hello, world!" --out hello.wav

# Save to MP3 file
cast "Hello, world!" --out hello.mp3 --format mp3

# Save audio with SRT subtitles
cast "Hello, world. This is a test." --out hello.wav --timestamp-out hello.srt
```

By default, `cast` plays audio immediately. Use `--out` to save a WAV or MP3 file instead.

<Info>
  CLI's immediate playback is the fastest terminal workflow for local realtime feedback. For API-level chunked streaming (`POST /v1/text-to-speech/stream`), see [Streaming TTS](/quickstart#stream-audio-in-real-time) and the SDK docs.
</Info>

## Options

| Flag | Description | Default |
|------|-------------|---------|
| `--voice-id` | Voice ID | `tc_60e5426de8b95f1d3000d7b5` |
| `--model` | Model (`ssfm-v30`, `ssfm-v21`) | `ssfm-v30` |
| `--language` | Language code (ISO 639-3) | auto-detected |
| `--emotion` | Emotion type: `smart`, `preset` | |
| `--emotion-preset` | Preset emotion (requires `--emotion preset`) | |
| `--emotion-intensity` | Emotion intensity 0.0-2.0 (requires `--emotion preset`) | `1.0` |
| `--prev-text` | Previous sentence for context (`--emotion smart` only) | |
| `--next-text` | Next sentence for context (`--emotion smart` only) | |
| `--volume` | Volume (0-200) | `100` |
| `--pitch` | Pitch in semitones (-12 to +12) | `0` |
| `--tempo` | Tempo multiplier (0.5-2.0) | `1.0` |
| `--remove-silence-ms` | Silence to retain (integer 0–1000 ms). 0 removes detected silence | unset |
| `--format` | Output format (`wav`, `mp3`) | `wav` |
| `--out` | Save to file instead of playing | |
| `--timestamp-out` | Save timestamp output to JSON, SRT, or WebVTT | |
| `--timestamp-format` | Timestamp output format (`json`, `srt`, `vtt`) | inferred from `--timestamp-out` |
| `--timestamp-granularity` | Timestamp granularity (`word`, `char`, `both`) | server default |

## Models

| Model | Languages | Emotions | Latency |
|-------|-----------|----------|---------|
| `ssfm-v30` | 35+ | 7 presets + smart emotion | Standard |
| `ssfm-v21` | 27 | 4 presets: normal, happy, sad, angry | Low |

```bash
cast "Hello, world!" --model ssfm-v21
```

## Emotions

<Tabs>
  <Tab title="Smart Emotion">
    AI automatically infers the appropriate emotion from the text. Smart emotion is available with `ssfm-v30`.

    ```bash
    cast "I just got promoted!" --emotion smart
    ```

    Provide surrounding sentences for better context:

    ```bash
    cast "I just got promoted!" --emotion smart \
      --prev-text "I have been working so hard this year." \
      --next-text "Let's celebrate tonight!"
    ```
  </Tab>
  <Tab title="Preset Emotion">
    Choose a specific emotion with `--emotion-preset`, and control its strength with `--emotion-intensity`.

    | Model | Available Presets |
    |-------|-------------------|
    | `ssfm-v30` | `normal`, `happy`, `sad`, `angry`, `whisper`, `toneup`, `tonedown` |
    | `ssfm-v21` | `normal`, `happy`, `sad`, `angry` |

    ```bash
    cast "Hello, world!" --emotion preset --emotion-preset happy
    cast "Hello, world!" --emotion preset --emotion-preset happy --emotion-intensity 2.0
    cast "Hello, world!" --emotion preset --emotion-preset whisper --emotion-intensity 0.5
    cast "Hello, world!" --model ssfm-v21 --emotion preset --emotion-preset sad
    ```
  </Tab>
</Tabs>

## Control silence duration

Use `--remove-silence-ms` with **Cast v1.0.10 or later**. The default is unset, not `0`.

```bash
cast "Hello. Thank you for listening." --voice-id tc_672c5f5ce59fac2a48faeaee --remove-silence-ms 300
```

`remove_silence_ms` specifies the **silence duration to retain**, not the amount to remove. Use an integer from `0` to `1000` ms. `0` removes detected silence; omission or `null` disables duration-based silence removal.

Standard, streaming, and timestamp TTS use `output.remove_silence_ms`; Compose uses `segments[].output.remove_silence_ms` on each `tts` segment. Returned timestamps align with the processed audio, and explicit `pause` segments are preserved.

Streaming's default leading-silence trimming is separate. Small values such as `0` can leave gaps between playable chunks; allow sufficient playback buffering and test with your content.
