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)
- Tongyi TTS (most natural for Chinese, many voices): Use if environment variable
DASHSCOPE_API_KEYis set.- Batch: Write narration as TSV with
number<TAB>line, runnode <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) andsentences[].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.
- Batch: Write narration as TSV with
- HyperFrames hosted dubbing: When no Tongyi key, HyperFrames is logged in (
npx hyperframes auth status), and quota remains, use hosted dubbing from/faceless-explainer. - macOS system Chinese voice (free, local, accurate):
say -v "<voice>" -r <rate> -o voice/line-<number>.aiff "<line>", then convert to WAV withffmpeg -i …aiff -ar 48000 -ac 1 …wav, read duration withffprobe. Rate-rdefault ~180, can be 200–220 for urgent characters. - 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.voicereturned byget_item. - If not set, pick from
voices.jsonin this skill directory based on character profile: voices withenginetongyirequire a Tongyi key,macosvoices 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 intoaudio_meta.jsonfollowing 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-cliis 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.