360 Secure SkillHub
360 安全技能中心

Chattts

通过 Node 脚本调用本地 ChatTTS FastAPI 服务,把文本合成为带笑声、停顿等自然语气的中文语音;可用 seed 切换音色,用 temperature 与 top_p 调节情绪表现力,脚本返回生成 wav 音频文件的本地绝对路径。需服务端已运行并配置接口地址环境变量。

djttt
djttt
热度 82.34
最近更新 2026-05-11 17:32:33
分类:创作依赖:代码执行 / 第三方 API / 读写文件应用场景:故事创作

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add chattts
Metadata
name
chattts
description
High-quality, conversational Text-to-Speech (TTS) generation via local ChatTTS API.
metadata
{"clawdbot":{"emoji":"🎙️","requires":{"bins":["node"],"env":["http://172.23.252.114:8020"]},"primaryEnv":"http://172.23.252.114:8020"}}

ChatTTS Voice Generator

AI-optimized conversational text-to-speech using a local ChatTTS server. Designed to generate highly natural human voices with realistic laughs, breathing, and pauses.

Generate Speech

node {baseDir}/scripts/tts.mjs "你要转换的语音文本"
node {baseDir}/scripts/tts.mjs "你好啊![laugh] 今天天气真不错,[uv_break] 我们出去玩吧?" --seed 2048
node {baseDir}/scripts/tts.mjs "写代码真是太开心了!" --seed 1234 --temperature 0.5

Options

  • --seed <number>: Random seed to fix the speaker's voice/timbre (default: 2048). Change this number to switch between different male/female voices.
  • --temperature <float>: Controls the emotional variance and stability (default: 0.3). Lower is more stable and clear, higher (e.g., 0.6) is more expressive but might mumble.
  • --top_p <float>: Top P sampling parameter for voice generation (default: 0.7).

Notes

  • Requires the local ChatTTS FastAPI server to be running (default target: http://172.23.252.114:8020).
  • Ensure CHATTTS_API_URL is set in your .env file if the API is hosted on a different machine.
  • PRO TIP: Always try to insert [laugh] (laughter) and [uv_break] (pauses/breaths) into the text to make the generated voice sound exactly like a real human.
  • The script will return the absolute local file path of the generated .wav audio file.