Inworld TTS
Generate speech audio from text using Inworld.ai's TTS API.
Setup
- 1. Get API key from https://platform.inworld.ai
- Generate key with "Voices: Read" permission
- Copy the "Basic (Base64)" key
- Set environment variable:
CODEBLOCK0
For persistence, add to ~/.bashrc or ~/.clawdbot/.env.
Installation
CODEBLOCK1
Usage
CODEBLOCK2
Options
| Option | Default | Description |
|---|
| INLINECODE2 | Dennis | Voice ID |
| INLINECODE3 |
1.0 | Speaking rate (0.5-2.0) |
|
--temp | 1.1 | Temperature (0.1-2.0) |
|
--model | inworld-tts-1.5-max | Model ID |
|
--stream | false | Use streaming endpoint |
API Reference
| Endpoint | Use |
|---|
| INLINECODE7 | Standard synthesis |
| INLINECODE8 |
Streaming for long text |
Requirements
- -
curl - HTTP requests - INLINECODE10 - JSON processing
- INLINECODE11 - Decode audio
Examples
CODEBLOCK3
Troubleshooting
"INWORLDAPIKEY not set" - Export the environment variable before running.
Empty output file - Check API key is valid and has "Voices: Read" permission.
Streaming issues - Ensure jq supports --unbuffered flag.
Links
- - Inworld Platform: https://platform.inworld.ai
- API Examples: https://github.com/inworld-ai/inworld-api-examples
Inworld TTS
使用 Inworld.ai 的 TTS API 从文本生成语音音频。
设置
- 1. 从 https://platform.inworld.ai 获取 API 密钥
- 生成具有Voices: Read权限的密钥
- 复制Basic (Base64)密钥
- 设置环境变量:
bash
export INWORLDAPIKEY=your-base64-key-here
如需持久化,请添加到 ~/.bashrc 或 ~/.clawdbot/.env。
安装
bash
将技能复制到你的技能目录
cp -r inworld-tts /path/to/your/skills/
使脚本可执行
chmod +x /path/to/your/skills/inworld-tts/scripts/tts.sh
可选:创建符号链接以便全局访问
ln -sf /path/to/your/skills/inworld-tts/scripts/tts.sh /usr/local/bin/inworld-tts
使用方法
bash
基础用法
./scripts/tts.sh Hello world output.mp3
带选项
./scripts/tts.sh Hello world output.mp3 --voice Dennis --rate 1.2
流式传输(用于超过4000字符的文本)
./scripts/tts.sh Very long text... output.mp3 --stream
选项
| 选项 | 默认值 | 描述 |
|---|
| --voice | Dennis | 语音ID |
| --rate |
1.0 | 语速 (0.5-2.0) |
| --temp | 1.1 | 温度参数 (0.1-2.0) |
| --model | inworld-tts-1.5-max | 模型ID |
| --stream | false | 使用流式传输端点 |
API 参考
| 端点 | 用途 |
|---|
| POST https://api.inworld.ai/tts/v1/voice | 标准合成 |
| POST https://api.inworld.ai/tts/v1/voice:stream |
长文本流式传输 |
系统要求
- - curl - HTTP请求
- jq - JSON处理
- base64 - 解码音频
示例
bash
快速测试
export INWORLD
APIKEY=aXM2...
./scripts/tts.sh Testing one two three test.mp3
mpv test.mp3 # 或任何音频播放器
不同语音和速度
./scripts/tts.sh Slow and steady slow.mp3 --rate 0.8
快节奏叙述
./scripts/tts.sh Breaking news! fast.mp3 --rate 1.5
故障排除
INWORLDAPIKEY not set - 运行前请导出环境变量。
输出文件为空 - 检查API密钥是否有效并具有Voices: Read权限。
流式传输问题 - 确保 jq 支持 --unbuffered 标志。
相关链接
- - Inworld 平台:https://platform.inworld.ai
- API 示例:https://github.com/inworld-ai/inworld-api-examples