Back to browse
GitHub Repository

Gapless audio playback javascript plugin (for seamless audio playback)

57 starsTypeScript

Gapless.js – gapless web audio playback

by switz·Mar 2, 2026·35 points·11 comments

AI Analysis

●●SolidNiche GemCozy

9-year battle-tested gapless playback library; xstate state machine ensures reliability over competitors.

Strengths
  • Rigid state machine architecture via xstate eliminates implicit state bugs common in audio players.
  • Production-proven at Relisten.net with 9 years of real-world gapless playback handling both HTML5 and Web Audio.
  • Minimal dependencies (one) and clean API reduce integration friction for developers.
Weaknesses
  • Mobile Web Audio support is weak; author acknowledges occasional HTML5-to-Web Audio blips and recommends native apps instead.
  • Niche audience (live audio streaming) limits broader appeal; most use cases solved adequately by simpler libraries.
Target Audience

Web developers building music players, DJ tools, or live stream playback requiring seamless track transitions.

Similar To

Howler.js · tone.js · wavesurfer.js

Post Description

Hey HN,

I just released v4 of my gapless playback library that I first built in 2017 to handle our audio playback on https://relisten.net where we stream live recordings and 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 the web audio support still lacks on mobile. 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.

Similar Projects

Mogamp – Winamp for macOS

The interface sells the concept — giant LED timer, spectrum visualizer and faux-metal skin give an authentic Winamp-era vibe, and the screenshot suggests careful pixel work. It's an early v0.1.0 release with only a small ZIP on GitHub, though, so unless it brings features beyond aesthetics (library management, modern audio backend, plugins/format support), it's mostly a nostalgia UI project rather than a must-have player.

Eye CandyNiche Gem
bbokan
203mo ago