mcpField
T
text-to-speech

text-to-speech

github.com/101-skills创意与媒体16167 次安装13 周前更新
代码仓库

关于 text-to-speech

通过 inference.sh 使用多种 TTS 模型将文本转为语音的 CLI 技能,提供语音、情绪、表达方式、延迟和长音频工作流示例。

主要功能

  1. 01提供多种 TTS 模型
  2. 02选择声音和语言
  3. 03行内控制情绪与表达方式
  4. 04低延迟语音生成
  5. 05对话及长篇音频生成
  6. 06提供视频旁白示例

适用场景

  1. 01制作产品演示配音
  2. 02生成有声书旁白
  3. 03将脚本制作为播客音频
  4. 04创作富有表现力的角色对话

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/101-skills/superpowers --skill text-to-speech

安装后在 Claude Code 中输入/text-to-speech确认已加载。

详细介绍

安装 belt CLI skill: npx skills add belt-sh/cli

文本转语音

通过 inference.sh CLI 将文本转换为自然语音。

文本转语音

快速开始

需要 inference.sh CLI(belt)。安装说明

belt login

# Generate speech
belt app run infsh/kokoro-tts --input '{"text": "Hello, welcome to our product demo."}'

可用模型

模型App ID最适用于
Inworld TTS-2inworld/text-to-speech-2100 多种语言、通过 [方括号] 调节情绪、多种表达模式
Inworld TTS 1.5 Maxinworld/text-to-speech-1-5-max低延迟(<200ms)、15 种语言
Inworld TTS 1.5 Miniinworld/text-to-speech-1-5-mini超低延迟(约 120ms)、15 种语言
ElevenLabs TTSelevenlabs/tts卓越品质、22 种以上音色、32 种语言
DIA TTSinfsh/dia-tts对话式、富有表现力
Kokoro TTSinfsh/kokoro-tts快速、自然
Chatterboxinfsh/chatterbox通用
Higgs Audioinfsh/higgs-audio情绪控制
VibeVoiceinfsh/vibevoice播客、长篇内容

浏览所有音频应用

belt app list --category audio

示例

基本文本转语音
belt app run infsh/kokoro-tts --input '{"text": "Welcome to our tutorial."}'
Inworld TTS-2 — 情绪调节

Inworld TTS-2 支持使用 [方括号] 通过自然语言进行调节——可在文本中直接控制情绪、音量、语速和非语言声音:

belt app run inworld/text-to-speech-2 --input '{
  "text": "I have some [exciting] news to share with you! [pause] We just hit one million users. [laugh]",
  "voice_id": "Sarah",
  "delivery_mode": "CREATIVE"
}'

表达模式:STABLE(一致)、BALANCED(自然,默认)、CREATIVE(富有表现力)。

内置音色(15 种语言,共 271 种以上):Sarah、Alex、Ashley、Dennis、Hana、Blake、Luna、Clive 等。可在 Inworld TTS Playground 中浏览所有音色,或通过 GET https://api.inworld.ai/voices/v1/voices 以编程方式列出。

Inworld TTS 1.5 — 低延迟

适用于速度至关重要的实时应用:

# Max quality at low latency (<200ms)
belt app run inworld/text-to-speech-1-5-max --input '{
  "text": "Welcome back! How can I help you today?",
  "voice_id": "Ashley"
}'

# Ultra-low latency (~120ms) for conversational AI
belt app run inworld/text-to-speech-1-5-mini --input '{
  "text": "Sure, let me look that up for you.",
  "voice_id": "Dennis"
}'
使用 DIA 生成对话式语音
belt app sample infsh/dia-tts --save input.json

# Edit input.json:
# {
#   "text": "Hey! How are you doing today? I'm really excited to share this with you.",
#   "voice": "conversational"
# }

belt app run infsh/dia-tts --input input.json
长篇音频(播客)
belt app sample infsh/vibevoice --save input.json

# Edit input.json with your podcast script
belt app run infsh/vibevoice --input input.json
使用 Higgs 生成富有表现力的语音
belt app sample infsh/higgs-audio --save input.json

# {
#   "text": "This is absolutely incredible!",
#   "emotion": "excited"
# }

belt app run infsh/higgs-audio --input input.json

使用场景

  • 配音:产品演示、说明视频
  • 有声读物:将文本转换为语音
  • 播客:生成播客节目
  • 无障碍访问:让内容更易于访问
  • IVR:电话系统语音提示
  • 视频旁白:为视频添加旁白
  • 游戏 / NPC:通过情绪调节生成角色语音(Inworld TTS-2)
  • 对话式 AI:生成超低延迟响应(Inworld TTS 1.5 Mini)
  • 虚拟形象 / UGC 视频:为说话人头部虚拟形象生成语音

与视频结合使用

创建真人头像视频最简单的方式是使用内置 TTS 的 P-Video-Avatar——无需单独处理音频:

belt app run pruna/p-video-avatar --input '{
  "image": "https://portrait.jpg",
  "voice_script": "Your script here",
  "voice": "Zephyr (Female)"
}'

对于不带内置 TTS 的模型(OmniHuman、PixVerse),请先生成语音:

# 1. Generate speech with Inworld TTS-2 (emotion steering)
belt app run inworld/text-to-speech-2 --input '{
  "text": "[friendly] Your script here. [excited] This is the best part!",
  "voice_id": "Sarah",
  "delivery_mode": "CREATIVE"
}' > speech.json

# 2. Use the audio URL with OmniHuman for avatar video
belt app run bytedance/omnihuman-1-5 --input '{
  "image_url": "https://portrait.jpg",
  "audio_url": "<audio-url-from-step-1>"
}'

相关技能

# ElevenLabs TTS (premium, 22+ voices)
npx skills add inference-sh/skills@elevenlabs-tts

# ElevenLabs dialogue (multi-speaker)
npx skills add inference-sh/skills@elevenlabs-dialogue

# Full platform skill (all apps)
npx skills add inference-sh/skills@infsh-cli

# AI avatars (combine TTS with talking heads)
npx skills add inference-sh/skills@ai-avatar-video

# AI music generation
npx skills add inference-sh/skills@ai-music-generation

# Speech-to-text (transcription)
npx skills add inference-sh/skills@speech-to-text

# Video generation
npx skills add inference-sh/skills@ai-video-generation

浏览所有应用:belt app list

文档

评论

支持 Markdown