Inworld TTS技能使用说明
2026-04-01
新闻来源:网淘吧
围观:20
电脑广告
手机广告
Inworld TTS
使用 Inworld.ai 的 TTS API 从文本生成语音音频。
设置
- 从以下网址获取 API 密钥https://platform.inworld.ai
- 生成具有“Voices: Read”权限的密钥
- 复制“Basic (Base64)”密钥
- 设置环境变量:
export INWORLD_API_KEY="your-base64-key-here"
如需持久化,请添加到~/.bashrc或~/.clawdbot/.env。

安装
# Copy skill to your skills directory
cp -r inworld-tts /path/to/your/skills/
# Make script executable
chmod +x /path/to/your/skills/inworld-tts/scripts/tts.sh
# Optional: symlink for global access
ln -sf /path/to/your/skills/inworld-tts/scripts/tts.sh /usr/local/bin/inworld-tts
用法
# Basic
./scripts/tts.sh "Hello world" output.mp3
# With options
./scripts/tts.sh "Hello world" output.mp3 --voice Dennis --rate 1.2
# Streaming (for text >4000 chars)
./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- 解码音频
示例
# Quick test
export INWORLD_API_KEY="aXM2..."
./scripts/tts.sh "Testing one two three" test.mp3
mpv test.mp3 # or any audio player
# Different voice and speed
./scripts/tts.sh "Slow and steady" slow.mp3 --rate 0.8
# Fast-paced narration
./scripts/tts.sh "Breaking news!" fast.mp3 --rate 1.5
故障排除
"未设置INWORLD_API_KEY"- 在运行前导出环境变量。
输出文件为空- 检查API密钥是否有效,并拥有“语音:读取”权限。
流传输问题- 确保jq支持--unbuffered标志。
链接
文章底部电脑广告
手机广告位-内容正文底部


微信扫一扫,打赏作者吧~