← ClaudeAtlas

caption-alignlisted

Get caption words onto the right frames and keep them there — derive frames from SOURCE word times through the cut's piece table (never from a re-transcribed cut), FORCE-ALIGN the caption text to the delivered audio with wav2vec2, then audit every run against the voice envelope for dead air. Carries the run-construction rules (≤3 words unconditional, never open on an article, ≥0.30 s, contiguous `to`), the section-anchor assertion and the stream rules for second voices and profanity. Use whenever captions are generated, retimed, rewritten, or reported out of sync.
vaibhav-barman/live-clipper · ★ 0 · AI & Automation · score 72
Install: claude install-skill vaibhav-barman/live-clipper
# CAPTION ALIGN — the right words on the right frames > **THE JOB:** three clocks are in play — the source stream, the concatenated cut, and the delivered > render — and every caption bug in the original project came from reading a time off the wrong one. > **Derive from the source, align to the render, audit against the waveform.** Adapted from the creator's skill. **Kept:** the three-clock model, the pipeline, every run rule and its reason, the pause audit. **Changed:** the cut map is `cut.json` (pieces `a`, `dur`) at 30 fps, the envelope is the Demucs voice stem, and there are rules for second voices and profanity. ## The pipeline ``` source word times ──(cut.json map)──► caption frames ──(wav2vec2 force-align)──► final anchors │ │ └──────► RMS pause audit ◄───────────────┘ ``` ## Step 1 — derive from SOURCE, never from a re-transcribed cut ```py def tl(src_sec, pieces, fps=30): # source seconds -> output frame t_out = 0.0 for p in pieces: # pieces from cut.json, in output order if p["a"] - 1/fps <= src_sec < p["a"] + p["dur"]: return round((t_out + (src_sec - p["a"])) * fps) t_out += p["dur"] return None # word was cut — must not be captioned ``` **Why:** per-piece `-ss/-t` rounds independently, so a re-transcribed cut and the true map diverge at every