Gapless.js
gapless web audio playback
Get picks like this daily. Today's launch numbers, the top launches, AI and tech news, and a daily opportunity pick, straight to your inbox.
Want to reach these readers? Sponsor an issue.
Hey HN,I just released v4 of my gapless playback library that I first built in 2017 for https://relisten.net. We stream concert recordings, where gapless playback is paramount.It's built from scratch, backed by a rigid state machine (the sole dependency is xstate) and is already running in production over at Relisten.The way it works is by preloading future tracks as raw buffers and scheduling them via the web audio API. It seamlessly transitions between HTML5 and web audio. We've used this technique for the last 9 years and it works fairly well. Occasionally it will blip slightly from HTML5->web audio, but there's not much to be done to avoid that (just when to do it - lotta nuance here). Once you get on web audio, everything should be clean.Unfortunately web audio support still lacks on mobile, in which case you can just disable web audio and it'll fallback to full HTML5 playback (sans gapless). But if you drive a largely desktop experience, this is fine. On mobile, most people use our native app.You can view a demo of the project at https://gapless.saewitz.com - just click on "Scarlet Begonias", seek halfway in the track (as it won't preload until >15s) and wait for "decoding" on "Fire on the Mountain" to switch to "ready". Then tap "skip to -2s and hear the buttery smooth segue.
HN · launched Mar 2, 2026 · 35 upvotes (top 19%) · 0 views
Niche: streaming media players and tools · 723 launches, 456 in the last 7 days ▲ +1371% · Explore this niche →
Category and tags
- Horizontal
- Dev tools
- Developer
- Not AI
- Hobby / open-source project
Visit website ↗ Source listing ↗
More like this: all 723 launches in streaming media players and tools →
Could you build this?
Partial While basic web audio playback is easy, rock-solid gapless multi-track playback across varying browsers and codecs requires complex Web Audio API buffering, audio decoding, and sample-accurate scheduling.
What it would actually take: A production gapless audio player relies on the Web Audio API (`AudioContext`, `AudioBufferSourceNode`, or `AudioWorklet`) rather than standard HTML5 `<audio>` tags, which introduce inevitable gaps. The system needs an intricate state machine (e.g., XState) to prefetch, decode in Web Workers, calculate exact sample offsets to eliminate encoder padding/delay (especially for MP3/AAC), and schedule buffer playback ahead of time using hardware clock timing (`audioContext.currentTime`). Doing this seamlessly across cross-browser quirks and mobile background restrictions requires specialized digital audio engineering expertise.
Discussion
11 comments analyzed.
Competitors mentioned: XState, Gapless-5, Museeks
Concerns raised: Audio playback state drops when switching between tabs, Occasional audio blips when switching tracks in Firefox, Not truly gapless on Firefox latest, Entire track must be loaded into memory before playing (vs progressive loading), Web Audio API complexity for developers
Feature requests: Use shorter example songs to demonstrate gapless playback, Implement parallel loading with mid-track HTML5 to Web Audio switching, Support RANGE requests for custom buffer management
Competitors
Other products that read as similar to this one : 538 launches clear the similarity bar, closest 8 shown.
Attention rank: #75 of 539 (itself plus its competitors, highest first, normalized so YC and Product Hunt are compared fairly).
Launched 124 days after the earliest competitor.
- Web Audio Studio · hn · 2026-03-02 · 64 upvotes · similarity 0.51
- Everything Is Remixed · hn · 2026-02-01 · 5 upvotes · similarity 0.50
- Waveform Playlist v5 · hn · 2026-01-07 · 10 upvotes · similarity 0.50
- Unboundcove Audio Tools · ph · 2026-11-01 · 1 upvotes · similarity 0.49
- YTSpoofingStream · ph · 2026-09-12 · 1 upvotes · similarity 0.48
- Gentle Volume · ph · 2026-10-18 · 1 upvotes · similarity 0.48
- Pauseless · hn · 2026-11-04 · 6 upvotes · similarity 0.48
- Video to Audio · ph · 2026-10-12 · 1 upvotes · similarity 0.47
The niche, labels, vibe code rating and competitor comparison on this page are analysis by Nicheloom. If you use them, please credit nicheloom.com. How you may use our data.