say

TotalClaw 作者 totalclaw

通过 macOS 使用 Siri 自然语音说出命令进行文本转语音。用于在 macOS 上生成语音音频、TTS 剪辑或大声朗读文本。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~tobihagemann-say
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~tobihagemann-say/file -o tobihagemann-say.md
# say

Use `say` for on-device text-to-speech on macOS.

## Siri Natural Voices (recommended)

Siri voices are the best macOS TTS voices but **cannot be selected via `-v`**. Instead, run `say` without `-v` — it uses the system default voice. Switch languages via `defaults write`:

```bash
# Switch to German
defaults write com.apple.speech.voice.prefs SystemTTSLanguage -string "de"
say "Hallo, wie geht's?" -o output_de.aiff

# Switch to Chinese (Mandarin)
defaults write com.apple.speech.voice.prefs SystemTTSLanguage -string "cmn"
say "你好,世界" -o output_zh.aiff
```

No process restart needed — the next `say` invocation picks up the new language immediately.

### Prerequisites

Download the desired Siri voices first in **System Settings > Accessibility > Spoken Content** and set them as the system voice for each language.

Check which voices are currently configured:

```bash
defaults read com.apple.Accessibility SpokenContentDefaultVoiceSelectionsByLanguage
```

## Fallback: select voice via `-v`

For non-Siri voices, use `-v` directly:

```bash
say -v 'Tingting (Enhanced)' "你好,世界"
say -v '?'  # list all installed voices (Siri voices not listed)
```

## Output to file

```bash
say -o output.aiff "Hello world"
ffmpeg -y -i output.aiff -ar 22050 -ac 1 output.wav  # convert to WAV
```

## Options

- `-v <voice>` — Select a non-Siri voice
- `-r <rate>` — Speaking rate in words per minute (e.g. `-r 150`)
- `-o <file>` — Save to AIFF file instead of playing aloud

## Notes

- `say` adds natural pauses at punctuation — no manual sentence splitting needed
- AIFF is the native output format; convert with ffmpeg for WAV/MP3
- For batch generation: set language once, generate all clips, then switch — minimizes `defaults write` calls

---

## 中文说明

# say

在 macOS 上使用 `say` 进行设备端文本转语音。

## Siri 自然语音(推荐)

Siri 语音是 macOS 上最好的 TTS 语音,但**无法通过 `-v` 选择**。相反,运行不带 `-v` 的 `say` —— 它会使用系统默认语音。通过 `defaults write` 切换语言:

```bash
# Switch to German
defaults write com.apple.speech.voice.prefs SystemTTSLanguage -string "de"
say "Hallo, wie geht's?" -o output_de.aiff

# Switch to Chinese (Mandarin)
defaults write com.apple.speech.voice.prefs SystemTTSLanguage -string "cmn"
say "你好,世界" -o output_zh.aiff
```

无需重启进程 —— 下一次调用 `say` 会立即采用新语言。

### 前提条件

请先在 **System Settings > Accessibility > Spoken Content** 中下载所需的 Siri 语音,并将其设置为每种语言的系统语音。

查看当前已配置的语音:

```bash
defaults read com.apple.Accessibility SpokenContentDefaultVoiceSelectionsByLanguage
```

## 备选方案:通过 `-v` 选择语音

对于非 Siri 语音,直接使用 `-v`:

```bash
say -v 'Tingting (Enhanced)' "你好,世界"
say -v '?'  # list all installed voices (Siri voices not listed)
```

## 输出到文件

```bash
say -o output.aiff "Hello world"
ffmpeg -y -i output.aiff -ar 22050 -ac 1 output.wav  # convert to WAV
```

## 选项

- `-v <voice>` —— 选择非 Siri 语音
- `-r <rate>` —— 说话语速,单位为每分钟字数(例如 `-r 150`)
- `-o <file>` —— 保存为 AIFF 文件,而非朗读出来

## 注意事项

- `say` 会在标点处添加自然停顿 —— 无需手动断句
- AIFF 是原生输出格式;用 ffmpeg 转换为 WAV/MP3
- 批量生成时:先设置一次语言,生成所有片段,然后再切换 —— 可最大限度减少 `defaults write` 调用