Video Sound Workbench
Break down the question "what sound should this video have" into four layers: Voiceover → Music → SFX → Mixing. Each layer first searches the library for real recordings, and finally delivers audio files directly importable into video editing projects.
Boundary: Sound only. Leave visuals to video-director (by default it writes code for frame-by-frame rendering, only using HyperFrames, Remotion, CapCut, etc. when the user specifies); this skill only outputs audio files, subtitle timings, time points, and volume recommendations.
Source Priority: Library First, Then Arrangement, Synthesis Last
| Order | Source | When to Use | Script |
|---|---|---|---|
| 1 | User-provided song | Must use if given; no substitution allowed | beats.py to detect beat points |
| 2 | HeyGen Library / SFX Library (default) | Look here first for music and SFX: real instruments, real recordings, diverse styles. Selected tracks must be beat-matched using beats.py + beat_timeline.py | heygen_audio.py |
| 3 | GarageBand arrangement | When no suitable track exists in the library and bar-accurate arrangement is necessary (e.g., dropping drums in/out to align with visuals). Choose kits based on what loops.py --kits actually lists; don't default to electronic kits | loops.py + arrange.py |
| 4 | Code synthesis | Last resort: truly absent from library, and only for short SFX | synth.py |
Why synthesis is last: Model-synthesized sounds all have a similar flavor (noise risers, 808 drops, FM dings), making a whole video sound like "the same old thing." The library contains real recordings, offering different options each time.
arrange.py can combine multiple sources in the same bar grid for mixing and stems export. examples/hype-15s demonstrates this mechanism, not a recommended style—don't replicate its electronic formula for the next project.
Hard Rules for Music and SFX
- Music must match the theme, not freelance: First derive a sentence describing what the video sounds like (mood, energy, instruments). Product introductions, project pitches, and launch videos default to dynamic, driving: crisp drums, upward momentum, an explosive section (energetic rock, cinematic percussion, upbeat funk, powerful hip-hop grooves). Save lazy jazz, lounge, lo-fi, ambient pads for when the user requests them or the content is quiet (sleep, meditation, nostalgia).
- Neither music nor SFX may overpower voiceover: SFX must be at least 6 dB below the voice during speech (
mix.pyenforces this). Music must be at least 12 dB below the voice during speech (default 15). Usemix.pyto mix; it calculates volumes based on these targets, measures again after mixing, and exits with code 3 if unmet. Real-world test: old manually tuned sidechain compression left music only 1.2 dB below voice—basically equally loud. - Transitions and keyframes must have SFX: One transition SFX per cut (whoosh, page flip, shutter, film click—pick by style) and one hit SFX per key action (land, reveal, stamp, light on). All from the library, volume below voice.
- Let the user audition candidates first: 2–3 candidates all within the direction set by the first sentence (not three completely different styles to guess from). Create an audition file and present it with the video-director proposal for user confirmation.
- Consult project records: Before starting, read
~/.video-skill/作品记录.md; avoid repeating the last 3 tracks, main instruments. Append after delivery. - Don't default to "electronic sound package": Do not default to the synthetic sound set (riser + 808 drop + impact + brand ding). Make the video dynamic through the music's own drums and arrangement, not through synthetic SFX stacking.
Workflow
- Voiceover first, determines duration: The voiceover length determines the video length. Read
references/voiceover.md.voiceover.py ttsgenerates voiceover: three sources:--source mineyour HeyGen voice clone (default),heygenHeyGen public voices,geminiGemini 3.8 Flash TTS (--stylecontrols tone). The default engine for cloned voices is often unavailable; it will automatically retry with orca → starfish.voiceover.py alignsegments the script into subtitles aligned with actual speech segments, outputtingcues.json. HeyGen's word-level timestamps are evenly divided across words and cannot be used for subtitle cueing.
- List visual beat points: Explosions, transitions, stamps, reveals—at which seconds. This shared timeline is used by both music and SFX. Subtitle dwell time ≥ word count × 0.25s + 0.5s; cue points must not sacrifice readability.
- Music: Read
references/music.md.- Start by writing one sentence of what the video sounds like. Use
heygen_audio.py search --type musicto find 3–4 stylistically different candidates, splice them into an audition clip for the user to choose. - Beat-match the selected track:
beats.pydetects beats and climax,beat_timeline.py --key <key moments>calculates the start time in the song and produces a beat-aligned shot timeline for the visuals. - Only if the library truly lacks a suitable track and bar-accurate arrangement is necessary, use
loops.py+arrange.pyto compose.
- Start by writing one sentence of what the video sounds like. Use
- SFX: Read
references/sfx.md. First search the HeyGen SFX library for real recordings; only synthesize if unavailable. Arrange by density tier: just transitions and key points, or add cue sounds for keywords. Alignment formula: Start time = hit time − peak offset in file. - Mixing and loudness: Write
mix.json, runmix.py: music is auto-ducked by voice (at least 12 dB lower during speech), SFX aligned by peak, final mix at -14 LUFS, true peak -1.5 dBTP, export stems. Readreferences/mixing.md. - Pre-delivery self-check:
audio_qa.pychecks: audio-video duration match, loudness, true peak, music gaps, ending fade-out, cut points on beat. Deliver only if exit code 0.
For uncertain styles, create an audition: 8–9 seconds of each candidate spliced into an A/B/C/D clip for the user to pick—far more effective than verbal description.
Ironclad Rules
- Only loops from the same kit can be stacked: GarageBand loops are grouped by song (e.g., "Cascade Bass / Lead / Pad"). Mixing across kits easily causes key mismatch and timing problems.
- Align to the hit point, not the file start: HeyGen SFX have
peak_offset; synthesized SFXsynth.pyprints the peak. - Subtitle timing is based on actual audio:
voiceover.py alignaligns the script to real segments separated by silence, without needing Whisper, and does not trust TTS-provided timestamps. - Export stems before delivery: When mixing, export separate stems per source so the user can hear each layer's contribution and easily adjust individual layers.
- User specifications are hard requirements: If the user specifies a song, voice service, or "no music," follow it. If unavailable, explain the reason and alternatives in the delivery notes; do not quietly substitute "something similar."
- When you can't hear, use data to verify: Use ebur128 for loudness, volumedetect for peak and silence detection, and waveform visuals for structure. The agent has no ears—rely on data for quality control. Ultimately, let the user judge if it sounds good.
Files
| File | Content | When to Read |
|---|---|---|
references/voiceover.md | Voice clones, engine fallback, pause syntax, subtitle alignment | Before voiceover |
references/music.md | Source selection, BPM derivation, arrangement patterns, cueing methods, audition creation | Before music |
references/sfx.md | SFX search terms, synthesis recipes, density tiers, alignment | Before SFX |
references/mixing.md | Ducking voice, loudness standards, placement in video editors, verification commands | Every wrap-up |
scripts/voiceover.py | List voices / TTS (clone, Heygen public, Gemini) / silence cut / subtitle alignment | |
scripts/loops.py | Scan Apple Loops, filter by BPM and kit | |
scripts/arrange.py | Mix according to plan.json into final track and stems | |
scripts/heygen_audio.py | Search and download HeyGen music, SFX | |
scripts/synth.py | Synthesize riser / sub / ding / whoosh / tick | |
scripts/beats.py | Detect BPM, beat points, downbeats, climax, loud/quiet sections of existing tracks | When using an existing track that needs beat-matching |
scripts/beat_timeline.py | Align climax to key moments, output cut commands and beat-aligned shot timeline | Same as above |
scripts/mix.py | Mix according to mix.json into final audio and stems, check if music overpowers voice | Every mix |
scripts/audio_qa.py | Pre-delivery audio self-check | Every wrap-up |
examples/hype-15s/ | Complete example combining three sources into a 15-second dynamic short track; bash make.sh to reproduce | First use or when a starting point is needed |
Dependencies: ffmpeg, Python 3 + numpy, heygen CLI (logged in), GarageBand on macOS (only uses its asset library at /Library/Audio/Apple Loops, no need to open the app).