Switching headphones mid-track without a gap
AudioArenaLab lets you pick any headphones, play the same song through each, and switch between them while it plays. The switch was the hardest part, and the fix was smaller than I expected.

Most headphone reviews ask you to trust someone else's ears, or to read a frequency-response graph. I wanted to compare headphones by ear: play one test track, recorded through different headphones, and switch between them while the music keeps going.
That only works if the switch is seamless. If you hear a gap or a click, you start comparing the glitch instead of the headphones.
What makes a fair comparison
The audio side came first. Every headphone is recorded the same way:
- Normalise with high- and low-pass filtered pink noise.
- Check that both ears play at equal loudness.
- Record at a safe 80 dB SPL listening level.
- Measure the frequency response with REW, then upload the clips and the measurement data.
Because every headphone is recorded the same way, any one can be compared with any other, or with several at once. 33 headphones already make 528 possible pairs, before you add a third or a fourth, across 12 curated test tracks.
The lag at the switch
The first version of switching always had a small lag at the moment of the switch. It was short, but you could hear it, and it made the whole idea feel broken.
The fix was simple but took a long time to find: add a small delay to the incoming track, so the switch feels seamless.
— what finally worked
Looking back, I didn't break the app into smaller parts, so the switch was hard to isolate and debug. The lesson I keep: break the problem into a smaller prototype and test it sooner.
Decode once, use everywhere
The player, the waveform progress bar, the spectrum analyser and the frequency-response charts all need the same audio. Fetching and decoding a track for each of them would be slow and wasteful, so one service caches the decoded AudioBuffer by URL, and the waveform peaks by URL and width. Nothing fetches or decodes a track twice.
What I'd do differently
Prototype the hardest interaction on day one, alone, before building the screens around it. The switch is the product; everything else is a frame for it.
Questions about this build, or want something like it for your product?
›How does the real-time headphone switching on AudioArenaLab work?enter ↵or email khanin.chom@gmail.com