Gapless.js
gapless web audio playback
Details
- External ID
- 47222271
- Source
- HN
- Company
- —
- Product
- Gapless.js
- Website domain
- github.com
- Launched
- March 2, 2026
- Cohort
- —
- Upvotes
- 35
- Upvotes percentile
- 0.8111931119311193
- Tags
- —
- Fetched at
- Sept. 7, 2026, 9:26 p.m.
- Updated at
- Sept. 7, 2026, 9:26 p.m.
Description
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.
Enrichment
- Theme
- audio and video developer utilities
- Vertical
- Media & entertainment
- Function
- Dev tools
- Audience
- Developer
- AI stance
- Not AI
- Project type
- Hobby / open-source project
- Normalized one-liner
- web audio library with gapless playback
- Manually corrected
- False
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 — 238 launches clear the similarity bar, closest 8 shown.
Attention rank: #44 of 239 (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.50
- Everything Is Remixed · hn · 2026-02-01 · 5 upvotes · similarity 0.50
- Waveform Playlist v5 · hn · 2026-01-07 · 10 upvotes · similarity 0.49
- YTSpoofingStream · ph · 2026-09-12 · 1 upvotes · similarity 0.48
- Audio369 · ph · 2026-09-15 · 1 upvotes · similarity 0.46
- Pulse 2.0 · hn · 2025-11-28 · 86 upvotes · similarity 0.46
- Crimson Player · ph · 2026-09-26 · 1 upvotes · similarity 0.44
- Rmp, a Subsonic music player for generating playlists on the fly · hn · 2026-08-23 · 5 upvotes · similarity 0.44
Other launches for this product
- No other launches for this product.
Same idea, different domain
Nobody's really built a dev tools tool for Sales yet.