speak
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/speak - Text-to-Speech
/speak - 文本转语音
Speak text using edge-tts (high-quality neural voices) with fallback to macOS .
say使用edge-tts(高品质神经语音)进行文本朗读,备选方案为macOS 命令。
sayQuick Start
快速开始
bash
/speak "Hello world" # Default English voice
/speak --thai "สวัสดีครับ" # Thai voice
/speak --voice "en-GB-RyanNeural" "Hi" # Specific voice
/speak --mac "Hello" # Force macOS saybash
/speak "Hello world" # 默认英文语音
/speak --thai "สวัสดีครับ" # 泰语语音
/speak --voice "en-GB-RyanNeural" "Hi" # 指定语音
/speak --mac "Hello" # 强制使用macOS sayOptions
选项
| Option | Description |
|---|---|
| Use Thai voice (th-TH-NiwatNeural) |
| Use female voice |
| Specific edge-tts voice |
| Force macOS say command |
| Speech rate (edge-tts: +/-50%, mac: 100-300) |
| List available voices |
| 选项 | 说明 |
|---|---|
| 使用泰语语音(th-TH-NiwatNeural) |
| 使用女性语音 |
| 指定edge-tts语音 |
| 强制使用macOS say命令 |
| 语速(edge-tts:±50%,mac:100-300) |
| 列出可用语音 |
Default Voices
默认语音
| Language | Voice |
|---|---|
| English | en-US-GuyNeural (male) |
| English | en-US-JennyNeural (female) |
| Thai | th-TH-NiwatNeural (male) |
| Thai | th-TH-PremwadeeNeural (female) |
| 语言 | 语音 |
|---|---|
| 英语 | en-US-GuyNeural(男性) |
| 英语 | en-US-JennyNeural(女性) |
| 泰语 | th-TH-NiwatNeural(男性) |
| 泰语 | th-TH-PremwadeeNeural(女性) |
Scripts
脚本
Located in :
src/skills/speak/scripts/| Script | Purpose |
|---|---|
| Main TTS script |
位于:
src/skills/speak/scripts/| 脚本 | 用途 |
|---|---|
| 主TTS脚本 |
Run Script
运行脚本
bash
cd src/skills/speak/scripts
bun speak.ts "Text to speak"
bun speak.ts --thai "ภาษาไทย"
bun speak.ts --listbash
cd src/skills/speak/scripts
bun speak.ts "Text to speak"
bun speak.ts --thai "ภาษาไทย"
bun speak.ts --listRequirements
依赖要求
- edge-tts: (optional, for high-quality voices)
pip install edge-tts - macOS say: Built-in (fallback)
- edge-tts:(可选,用于高品质语音)
pip install edge-tts - macOS say:系统内置(备选方案)
How It Works
工作原理
- Check if edge-tts is available
- If yes: Use edge-tts with neural voice
- If no: Fall back to macOS command
say - Play audio through default output
- 检查edge-tts是否可用
- 若可用:使用edge-tts的神经语音
- 若不可用:切换至macOS 命令
say - 通过默认输出设备播放音频
Examples
示例
bash
undefinedbash
undefinedSpeak Gemini response
朗读Gemini响应
/speak "The answer is 42"
/speak "The answer is 42"
Thai greeting
泰语问候
/speak --thai "สวัสดีครับ ยินดีต้อนรับ"
/speak --thai "สวัสดีครับ ยินดีต้อนรับ"
British accent
英式口音
/speak --voice "en-GB-RyanNeural" "Brilliant!"
/speak --voice "en-GB-RyanNeural" "Brilliant!"
List all voices
列出所有可用语音
/speak --list
undefined/speak --list
undefined