Communitygithub.com

voice-over:自然的中文配音轨,每句带时长

把旁白和角色台词合成为一句一个 wav 并标好时长的 Agent 技能,直接拿去对齐字幕和画面。配了 DASHSCOPE_API_KEY 就用阿里云百炼的通义语音,其次用 HyperFrames 托管配音,否则用 macOS 自带的免费中文语音,全程不停下来提问。

voice-over:自然的中文配音轨,每句带时长 是什么?

讲解视频配方第 2 步(配音),来自 ymybxx/SoloMCN(MIT,2026-10-09 创建),一个基于 Claude Code 的短视频工作室,README 开头有演示视频和工作台截图。voice-over 嵌在 SoloMCN 的 make-video 和 revise-video 流程里,也能单独拿来试音色。它按顺序用第一个能用的方式:通义 TTS(自带脚本,可从 TSV 批量合成,语速 0.9 到 1.15,输出含秒数和每句结束时间的 JSON),已登录且有额度时用 HyperFrames 托管配音,再到 macOS say 转成 48 kHz wav 并用 ffprobe 读时长,最后都不行就做纯字幕版并写明原因。它提醒本地 Kokoro 念中文错得多,每个角色固定一个声音,只用合成音色、不克隆不模仿真人,难念的缩写和数字改写后再合成而字幕保留原文,本机有 whisper-cli 时会回听抽查。在这个配方里,它给出的每句秒数就是 khan-explainer 真人音频模式里的 at 时间点。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ymybxx/SoloMCN/tree/HEAD/defaults/skills/voice-over

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Dubbing

Synthesize lines into WAV files, one per segment, output the duration of each, register into audio_meta.json for the video production pipeline, and align subtitles. When fully unattended, do not ask questions or wait for replies; use whichever method is available, and clearly document it in the production notes.

1. Choose the method (use the first available)

  1. Tongyi TTS (most natural for Chinese, many voices): Use if environment variable DASHSCOPE_API_KEY is set.
    • Batch: Write narration as TSV with number<TAB>line, run node <skill-dir>/scripts/tongyi-tts.mjs --voice <voice> --lines voice/lines.tsv --outdir voice
    • Single line: node <skill-dir>/scripts/tongyi-tts.mjs --voice <voice> --text "line" --out voice/line-01.wav
    • Each line outputs JSON with seconds (duration) and sentences[].end_s (end time of each sentence) for subtitle alignment.
    • Speed via --speed (default 1.0, adjust between 0.9–1.15), generally no need to change.
  2. HyperFrames hosted dubbing: When no Tongyi key, HyperFrames is logged in (npx hyperframes auth status), and quota remains, use hosted dubbing from /faceless-explainer.
  3. macOS system Chinese voice (free, local, accurate): say -v "<voice>" -r <rate> -o voice/line-<number>.aiff "<line>", then convert to WAV with ffmpeg -i …aiff -ar 48000 -ac 1 …wav, read duration with ffprobe. Rate -r default ~180, can be 200–220 for urgent characters.
  4. If none work: Create a version without dubbing where subtitles carry the lines; state the reason in the notes.

Do not use HyperFrames' built-in local Kokoro for Chinese: Chinese pronunciation errors are many, mostly unintelligible; English-only lines are acceptable.

2. Choose the voice

  • First use the voice set by the content's series (or account): account.voice returned by get_item.
  • If not set, pick from voices.json in this skill directory based on character profile: voices with engine tongyi require a Tongyi key, macos voices are always available. If a Tongyi voice is set but no key is available, pick a system voice with similar gender and age.
  • Use one voice per character, keep consistent throughout the video; use the most stable voice for narration.
  • Use only synthetic voices; do not clone or imitate any real person's voice.

3. After synthesis

  • Read the duration of each file with ffprobe, register into audio_meta.json following the method for existing dubbing files in /faceless-explainer (place files in the project, indicate source), then run duration synchronization and subtitles.
  • For mispronounced words (English abbreviations, numbers, heteronyms), rewrite them into easier-to-pronounce forms before synthesizing that line; subtitles still show the original text. If whisper-cli is available locally, spot-check a few sentences by listening back.
  • In the production notes, clearly document: which method was used, which voices, and why it fell back to the next method.

4. Configuring the Tongyi key (for the user)

This skill does not go through the workbench settings. To use Tongyi, add the following to the project's .claude/settings.local.json (not committed to git):

{ "env": { "DASHSCOPE_API_KEY": "your-tongyi-key" } }

To apply to all projects, write it in ~/.claude/settings.json. You can also directly tell Claude Code: "Help me configure the Tongyi dubbing key." The key can be obtained from the Alibaba Cloud Bailian console.

Individual skills in this repo

This repo contains 3 individual skills — each has its own dedicated page.

相关技能