subtitle / by UGK Official

Subtitle To Speech

给定一个中文字幕文件,用 MiMo TTS 生成按字幕时间轴铺好的中文配音音频。

Install

ugk task install subtitle-to-speech

This task installs 7 files from the official manifest, including 2 script files.

Runtime input

subtitlePath必填,中文字幕文件路径,支持 .srt 或 .vtt。必须原样提取为路径字符串。
voice可选 MiMo 预置音色 ID,必须精确填 ID,不能填自然语言描述。完整列表: mimo_default、冰糖、茉莉、苏打、白桦、Mia、Chloe、Milo、Dean。中文女声: 冰糖/茉莉; 中文男声: 苏打/白桦。dispatcher 应根据用户想要的语言、性别和气质选择最接近的 ID,把语气、节奏、感染力等表达方式写入 stylePrompt。
stylePrompt可选 MiMo 风格控制提示。默认使用自然清晰、适合视频解说的中文语气。
maxChars可选,每个 TTS 分组的最大中文字符数,默认 120。数值越小越贴近字幕时间轴,但 API 调用次数更多。

Acceptance

checksource.cues.json 存在且 cue 数量大于 0。
checkdub.zh.wav 存在,ffprobe 可解析,且 duration > 0。
checktts-summary.json 存在且记录 subtitlePath、voice、cueCount、speechGroupCount、dubAudioPath,且 voice 等于本次输入 voice。
checktts-segments/ 存在。