Raw PCM cross-correlation fails on different masters/mixes (all candidates
have near-identical confidence). Chromaprint generates perceptual hashes
that are invariant to mastering, so the correct offset is always in the
top 2 candidates with clear separation. Still generates comparison WAVs
for ear verification since repetitive songs can have ambiguous top picks.
Requires fpcalc (chromaprint) on PATH in addition to ffmpeg.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Offsets verified by ear using comparison WAVs:
- Chop Suey: GK-DkHHAMIU offset 8.968s
- Just Dance: 5q7byFPTehs offset 0.062s
- Meet Me Halfway: -GY8MhHMxLM offset 6.973s
Also fix offset tool: handle video IDs starting with '-' via --yt flag,
skip negative/empty offset candidates in WAV generation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Correct offset from 66.389 to 0.207 (was matching repeated section).
The tool now generates stereo comparison WAV files (left=local,
right=YouTube) for each candidate so you can verify by ear.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace direct HTML5 Audio usage with an AudioPlayer abstraction that
supports both local audio files and YouTube IFrame Player API. Songs
can now specify a youtubeVideoId and youtubeOffset to stream audio
from YouTube instead of hosting audio files.
- AudioPlayer interface with LocalAudioPlayer and YouTubeAudioPlayer
- YouTube IFrame API type declarations and script loader
- Cross-correlation offset detection tool (tools/audio-offset/)
- Get Lucky configured with YouTube video 5NV6Rdv1a3I, offset 66.389s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>