name: text-to-speech description: 将文本转换为语音音频文件,支持多种声音和语言。 metadata: short-description: 文字转语音 source: repository: https://github.com/pyttsx3/pyttsx3 license: MPL-2.0
文字转语音工具
描述
将文本转换为语音音频文件,支持多种语音、语言和语速。
触发条件
/tts命令- 用户需要文字转语音功能
- 用户想要生成音频
使用方法
# 朗读文本
python scripts/text_to_speech.py "Hello World"
# 保存到文件
python scripts/text_to_speech.py "Hello World" --output hello.mp3
# 更改语音/语速
python scripts/text_to_speech.py "Hello" --rate 150 --voice 1
# 从文件读取
python scripts/text_to_speech.py --file document.txt --output audio.mp3
标签
tts, speech, audio, voice, accessibility
兼容性
- Codex: ✅
- Claude Code: ✅