Files
hpr-intro-stripper/docs/images
Lee Hanken 5b2426e5ad Add DTW-based chroma matching as a fallback for tempo-drifted jingle matches
Fixed-lag cross-correlation (even after the leading_anchor_windows fix)
cannot find every real match: hpr0901 and hpr0902 share hpr0900's
confirmed jingle (by ear, and by a matching ~34s intro-envelope duration
across all three) but never correlate above ~0.3-0.4 against it at any
single fixed lag or speed ratio, because the jingle has internal tempo
variation no global alignment can follow.

Adds audio.dtw_chroma_match: chroma-feature DTW against a reference
clip, which isn't defeated by that since it doesn't assume one global
alignment, and whose warping-path end position gives a real intro_end
estimate. Optional dependency (librosa), same philosophy as ASR -- a
missing import returns None, never an exception. Wired into
detect._sibling_fallback as a last resort, tried only when fixed-lag
correlation finds nothing, since it's far more expensive.

Calibrated on real episodes against the newly vendored
references/pre2015_jingle_variant_b.flac (hpr0900's jingle, confirmed
to recur in ~5% of a random sample): confirmed/likely matches scored
cost 0.09-0.17, a confirmed non-match (hpr0898, no intro at all) scored
0.94. Also tried and rejected for this purpose: generic chroma
classification (can't tell whose music it is, not just that it's music)
and chromaprint/pyacoustid fingerprinting (clean separation but no
tolerance for tempo drift). See docs/DESIGN.md for the full writeup,
including a screenshot showing the matching intro-envelope duration
that motivated this.
2026-11-22 15:21:52 +00:00
..