frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Gapless.js – gapless web audio playback

https://github.com/RelistenNet/gapless.js
14•switz•2h ago
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.

Comments

modec•1h ago
How does this relate to https://github.com/regosen/Gapless-5 - looks like that is also recently updated.
switz•1h ago
Gapless 5 was actually the pre-cursor to this library over a decade ago, so Rego deserves full credit. They built the first example of gapless playback on the web and I took inspiration from their techniques.

Gapless 5 has a built in UI and style. Our library is headless: you bring your own UI and controls. It just depends on what your use-case is.

martpie•1h ago
Look very nice, I may end up using for https://museeks.io, gapless playback has been on the roadmap for a while, but WebAudio APIs have always been super cryptic, a higher-level API is very much welcome.
switz•1h ago
Thanks! Please do share if you choose to implement it (you can open a Github issue). I'd be glad to add any projects using it to the README.
NoahZuniga•44m ago
It's not gapless on firefox latest.
switz•38m ago
I run Firefox latest so it should work. There's always a risk when going from HTML5->Web Audio. There's an occasional blip that's impossible to avoid (or at least, I have never found a solution). It doesn't happen every time though. Try going from track 2 to track 3 in the second tab of the demo (if both are "READY" as web audio).

The problem with exclusively using the web audio API is that the entire track must be loaded into memory before playing it, whereas HTML5 loads progressively. So we use both to balance the techniques.

In prior versions of the library, we'd load the track in parallel to HTML5 and make the switch mid-track so it's actually far less noticeable even if it does blip. I'm considering adding that to the new version.

Another alternative is building a custom buffer using RANGE requests to exclusively drive it via the web audio API. But obviously that is a far more complex undertaking (and requires the server to support RANGE requests). I'm open to implementing it, though.

Show HN: Govbase – Follow a bill from source text to news bias to social posts

https://govbase.com
89•foxfoxx•3h ago•48 comments

Show HN: uBlock filter list to blur all Instagram Reels

https://gist.github.com/shraiwi/009c652da6ce8c99a6e1e0c86fe66886
37•shraiwi•1h ago•8 comments

Show HN: Omni – Open-source workplace search and chat, built on Postgres

https://github.com/getomnico/omni
142•prvnsmpth•11h ago•39 comments

Show HN: Writing App for Novelist

https://novelos.studio/
4•oknoorap•41m ago•1 comments

Show HN: Watchtower – see every API call Claude Code and Codex CLI make

https://github.com/fahd09/watchtower
2•fahd09•58m ago•1 comments

Show HN: Gapless.js – gapless web audio playback

https://github.com/RelistenNet/gapless.js
14•switz•2h ago•6 comments

Show HN: Web Audio Studio – A Visual Debugger for Web Audio API Graphs

https://webaudio.studio/
48•alexgriss•9h ago•4 comments

Show HN: Timber – Ollama for classical ML models, 336x faster than Python

https://github.com/kossisoroyce/timber
176•kossisoroyce•19h ago•30 comments

Show HN: I spent a billion tokens bridging Elixir and WebAssembly

https://yev.bar/firebird
2•yevbar•1h ago•1 comments

Show HN: Try Archetype 360 – AI‑powered personality test, 3× deeper than MBTI

https://archetype360.app/
5•ddesposito•5h ago•4 comments

Show HN: Smart-commit-rs – A zero-dependency Git commit tool in Rust

https://github.com/gtkacz/smart-commit-rs
2•gtkacz•2h ago•0 comments

Show HN: Valkey-powered semantic memory for Claude Code sessions

2•kaliades•2h ago•0 comments

Show HN: Punch card simulator and Fortran IV interpreter

https://punch.ehrlich.dev/
2•behrlich•2h ago•0 comments

Show HN:Logic gates as persistent stateful tasks – a BCD decoder built on a VM

2•tracyspacy•1h ago•0 comments

Show HN: Slop Meter for GitHub

3•FanaHOVA•51m ago•0 comments

Show HN: Ledge - Policy layer for AI agent payments (prevents unauthorized txns)

https://github.com/Devendra116/ledge
2•devendra116•4h ago•0 comments

Show HN: Clean Express – a native NNTP/Usenet client for iOS/macOS/visionOS

https://testflight.apple.com/join/DmBXsPhU
4•jim180•4h ago•0 comments

Show HN: MoodJot – Mood tracker mobile app with community feed, built with KMP

https://moodjot.app
3•appmuzzik•4h ago•0 comments

Show HN: Open-source Loom / Screen Studio with editing and auto-zoom

https://github.com/jkuri/Reframed
6•kundi•4h ago•3 comments

Show HN: I built a zero-browser, pure-JS typesetting engine for bit-perfect PDFs

https://github.com/cosmiciron/vmprint
71•cosmiciron•1d ago•50 comments

Show HN: Ralphex – autonomous GPT Codex agent loop for ChatGPT Pro users

https://github.com/SmolNero/ralphex
3•edgar_ortega•5h ago•0 comments

Show HN: Dungeon Coverage – Unit testing as a dungeon crawler

https://arvindrajnaidu.github.io/dungeon-coverage/
2•arvindrajnaidu•5h ago•0 comments

Show HN: HushBrief – A stateless, zero-retention AI document summarizer

https://hushbrief.app
3•FidelitasLLC•6h ago•0 comments

Show HN: Aigent – A general-purpose AI agent built for self-improvement

https://stefanochiodino.github.io/aigent/
2•StefanoC•6h ago•0 comments

Show HN: Rust Based SEO and AEO Crawler

https://crawler.sh/
2•mehmetkose•6h ago•0 comments

Show HN: Sairo – Self-hosted S3 browser with 2.4ms search across 134K objects

4•ashwathstephen•6h ago•1 comments

Show HN: Two tools to make Claude Code more autonomous

5•yuu1ch13•6h ago•2 comments

Show HN: PEP 827 – TS-like type manipulation in Python

https://peps.python.org/pep-0827/
2•1st1•1h ago•0 comments

Show HN: Logira – eBPF runtime auditing for AI agent runs

https://github.com/melonattacker/logira
22•melonattacker•21h ago•2 comments

Show HN: IDAssist – AI augmented reverse engineering for IDA Pro

https://github.com/jtang613/IDAssist
4•jtang613•7h ago•0 comments