网淘吧来吧,欢迎您!

Inworld TTS技能使用说明

2026-04-01 新闻来源:网淘吧 围观:20
电脑广告
手机广告

Inworld TTS

使用 Inworld.ai 的 TTS API 从文本生成语音音频。

设置

  1. 从以下网址获取 API 密钥https://platform.inworld.ai
  2. 生成具有“Voices: Read”权限的密钥
  3. 复制“Basic (Base64)”密钥
  4. 设置环境变量:
export INWORLD_API_KEY="your-base64-key-here"

如需持久化,请添加到~/.bashrc~/.clawdbot/.env

Inworld TTS

安装

# 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

选项

选项默认值描述
--voiceDennis语音 ID
--rate1.0语速 (0.5-2.0)
--temp1.1温度 (0.1-2.0)
--modelinworld-tts-1.5-max模型 ID
--streamfalse使用流式端点

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标志。

链接

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏

文章底部电脑广告
手机广告位-内容正文底部

相关文章

您是本站第393692名访客 今日有1篇新文章/评论