Kokoro TTS
This skill allows you to generate high-quality AI speech using a local or remote Kokoro-TTS instance.
Configuration
The skill uses the KOKORO_API_URL environment variable to locate the API.
- - Default: INLINECODE1
- To Configure: Add
KOKORO_API_URL=http://your-server:port/v1/audio/speech to your .env file or environment.
Usage
To generate speech, run the included Node.js script.
Command
CODEBLOCK0
- - text: The text to speak. Wrap in quotes.
- voice: (Optional) The voice ID. Defaults to
af_heart. - speed: (Optional) Speech speed (0.25 to 4.0). Defaults to
1.0.
Example
CODEBLOCK1
Output
The script will output a single line starting with MEDIA: followed by the path to the generated MP3 file. OpenClaw will automatically pick this up and send it as an audio attachment.
Example Output:
INLINECODE7
Available Voices
Common choices:
- -
af_heart (Default, Female, Warm) - INLINECODE9 (Female, Professional)
- INLINECODE10 (Male, Deep)
- INLINECODE11 (British Female)
For a full list, see references/voices.md or query the API.
Kokoro TTS
此技能允许您使用本地或远程的Kokoro-TTS实例生成高质量的AI语音。
配置
该技能使用KOKOROAPIURL环境变量来定位API。
- - 默认值: http://localhost:8880/v1/audio/speech
- 配置方法: 在您的.env文件或环境中添加KOKOROAPIURL=http://your-server:port/v1/audio/speech。
使用方法
要生成语音,请运行附带的Node.js脚本。
命令
bash
node skills/kokoro-tts/scripts/tts.js <文本> [语音] [语速]
- - 文本:要朗读的文本。请用引号括起来。
- 语音:(可选)语音ID。默认为af_heart。
- 语速:(可选)语速(0.25到4.0)。默认为1.0。
示例
bash
node skills/kokoro-tts/scripts/tts.js 你好Ed,我是Theosaurus在说话。 af_nova
输出
脚本将输出一行以MEDIA:开头的内容,后跟生成的MP3文件路径。OpenClaw将自动捕获此信息并将其作为音频附件发送。
示例输出:
MEDIA: media/tts_1706745000000.mp3
可用语音
常用选项:
- - afheart(默认,女声,温暖)
- afnova(女声,专业)
- amadam(男声,深沉)
- bfalice(英式女声)
完整列表请参见references/voices.md或查询API。