konradre/video-production-skills / skills/spot-audio-assembly
spot-audio-assembly
VerifiedAssembles the SOUND of a generated-video piece: voice-over takes (one voice and model per role), dubs for refused lines in the character's cloned voice, off-screen lines, sfx with the syllable map confirmed before the cut, music cues cut to markers with ducks, room tone, captions, the stem, and the read of the delivered audio. Use when a line must be voiced or re-voiced, a line was refused, sfx or music must be sourced or cut, captions must be built, a take's audio carries an artifact, or the delivered audio must be verified. Triggers — "generate the VO", "same voice as before", "dub the line", "the off-screen voice", "the sting", "the syllable map", "the music is too loud", "duck the music", "room tone", "captions", "is the vo on time", "musical artifact at the start". Not for placing lines on the timeline or the beat gate — use video-edit-edl. Not for the master render or the delivery encode — use video-finish-qc. Not for LUFS mastering of a finished mix — use mastering-audio.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 22.0 KB |
| references/CAPTIONS.md | markdown | 5.4 KB |
| references/MIX-AND-QC.md | markdown | 13.4 KB |
| references/SFX-AND-MUSIC.md | markdown | 13.2 KB |
| references/VO-PIPELINE.md | markdown | 6.6 KB |
| scripts/audio_head_scan.pyexecutable | script | 3.9 KB |
| scripts/beat_grid.pyexecutable | script | 30.1 KB |
| scripts/build_captions.pyexecutable | script | 8.8 KB |
| scripts/build_vo_stem.pyexecutable | script | 5.7 KB |
| scripts/gen_vo.pyexecutable | script | 7.0 KB |
| scripts/music_loop.py | script | 7.6 KB |
| scripts/music_take_read.py | script | 28.2 KB |
| scripts/qc_vo_placement.pyexecutable | script | 4.2 KB |
| scripts/roomtone_synth.pyexecutable | script | 3.4 KB |
| scripts/sfx_onsets.pyexecutable | script | 7.2 KB |
| scripts/sound_table.pyexecutable | script | 33.5 KB |
| scripts/vo_word_times.pyexecutable | script | 6.4 KB |
| scripts/voice_ab_reel.py | script | 3.9 KB |
scripts/audio_head_scan.py
View on GitHub#!/usr/bin/env python3
"""audio_head_scan.py — a generated TONE at a take's audio head (a sustained note under a quiet cut doubles a quiet
bed — e.g. 520 Hz for 0.9 s — and is heard as a musical artifact). The first --secs seconds of each file are
scanned in 50 ms windows: spectral flatness over 100–8000 Hz below --flat (tonal) with a peak bin stable (±2 bins)
for at least --min-run seconds is reported as TONE <f> Hz <a>–<b> s. The fix is native_audio_from at <b> (or a mute
plus synthesized room tone — roomtone_synth.py), never a pasted ambience slice. Self-test first: a synthesized 520 Hz
note must be flagged and white noise must not, or nothing else is printed.
audio_head_scan.py --root <project> (--edl edit/<SPOT>-EDL.json | --files takes/a.mp4 …) [--secs 1.5] [--flat 0.3] [--min-run 0.3]
"""
import argparse, json, os, subprocess, sys
import numpy as np
SR = 48000; WIN = 0.050
def pcm(f, t):
return np.frombuffer(subprocess.run(['ffmpeg', '-v', 'error', '-t', f'{t:.3f}', '-i', f, '-f', 'f32le', '-ac', '1', '-ar', str(SR), '-'], capture_output=True, check=True).stdout, np.float32)
def tones(x, flat_thr, min_run):
n = int(WIN * SR); w = np.hanning(n); fr = np.fft.rfftfreq(n, 1 / SR); band = (fr >= 100) & (fr <= 8000); runs = []; cur = None
for i in range(len(x) // n):
seg = x[i * n:(i + 1) * n]
if np.sqrt(np.mean(seg ** 2)) < 10 ** (-60 / 20): flat, pk = 1.0, -1
else:
P = np.abs(np.fft.rfft(seg * w)) ** 2; Pb = P[band] + 1e-18; flat = float(np.exp(np.mean(np.log(Pb))) / np.mean(Pb)); pk = int(np.argmax(Pb))
tonal = flat < flat_thr and pk >= 0
if tonal and cur and abs(pk - cur[2]) <= 2: cur[1] = (i + 1) * WIN
else:
if cur and cur[1] - cur[0] >= min_run: runs.append(cur)
cur = [i * WIN, (i + 1) * WIN, pk, float(fr[band][pk]) if pk >= 0 else 0.0] if tonal else None
if cur and cur[1] - cur[0] >= min_run: runs.append(cur)
return [(round(r[0], 2), round(r[1], 2), round(r[3])) for r in runs]
def main():
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument('--root', default='.'); ap.add_argument('--edl'); ap.add_argument('--files', nargs='*', default=[]); ap.add_argument('--secs', type=float, default=1.5)
ap.add_argument('--flat', type=float, default=0.3); ap.add_argument('--min-run', type=float, default=0.4)
ap.add_argument('--drone-hz', type=float, default=250, help='a stable peak below this reads as DRONE (a generated low hum), above as TONE (a note)')
a = ap.parse_args(); os.chdir(a.root)
t = np.arange(int(1.0 * SR)) / SR; rng = np.random.default_rng(1)
sine = (0.2 * np.sin(2 * np.pi * 520 * t) + 0.002 * rng.standard_normal(len(t))).astype(np.float32); noise = (0.1 * rng.standard_normal(len(t))).astype(np.float32)
ts, tn = tones(sine, a.flat, a.min_run), tones(noise, a.flat, a.min_run)
if not (ts and abs(ts[0][2] - 520) <= 40) or tn: sys.exit(f'SELF-TEST FAILED: sine -> {ts}, noise -> {tn}; the instrument is broken, no files scanned')
print(f'self-test ok: a 520 Hz note reads as {ts[0]}, white noise reads clean')
files = list(a.files)
if a.edl: files += [x['take'] for x in json.load(open(a.edl, encoding='utf-8'))['events'] if x.get('take') and x.get('source') != 'designed']
seen = set(); flagged = 0
for f in files:
if f in seen or not os.path.exists(f): continue
seen.add(f); r = tones(pcm(f, a.secs), a.flat, a.min_run)
if r: flagged += 1
lab = 'TONE ' if any(hz >= a.drone_hz for _, _, hz in r) else 'DRONE' if r else 'clean'
print(f"{lab} {f}" + ''.join(f" {'tone' if hz >= a.drone_hz else 'drone'} {hz} Hz {s0}–{s1} s" for s0, s1, hz in r))
print(f'{flagged} of {len(seen)} file(s) carry a stable tone or drone in the first {a.secs} s — the ear decides which are artifacts; the scan only locates them')
if __name__ == '__main__':
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |