mcpField
T
text-to-speech

text-to-speech

github.com/inference-sh创意与媒体7901.1k 次安装2 周前更新
代码仓库

关于 text-to-speech

通过 inference.sh CLI 将文本转换为语音的技能,涵盖多种 TTS 模型,可用于情绪表达、对话语音和长篇旁白。

主要功能

  1. 01通过 belt CLI 运行 TTS 应用
  2. 02选择多种语音模型
  3. 03在文本中控制情绪和表达方式
  4. 04生成对话及长篇音频

适用场景

  1. 01制作产品演示配音
  2. 02将有声书文本转换为语音
  3. 03生成播客音频
  4. 04制作带情绪变化的游戏角色语音

安装

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

$npx skills add https://github.com/inference-sh/skills --skill text-to-speech

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

详细介绍

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

文本转语音

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

文本转语音

快速开始

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

belt login

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

可用模型

模型App ID最适合
Inworld TTS-2inworld/text-to-speech-2支持 100 多种语言、使用 [方括号] 调节情绪、多种表达模式
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 TTSfalai/kokoro-tts快速、自然
Chatterboxinfsh/chatterbox通用
Higgs Audioinfsh/higgs-audio情绪控制
VibeVoiceinfsh/vibevoice播客、长篇内容

浏览所有音频应用

belt app list --category audio

示例

基本文本转语音
belt app run falai/kokoro-tts --input '{"prompt": "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": "https://portrait.jpg",
  "audio": "<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