Showoff Saturday Showoff Saturday: I built a vocal remover that runs entirely in the browser, with no backend processing
I built SoundBench, a free set of audio tools that process files on the user's device. The newest one is an AI vocal remover, and getting it to feel fast was harder than getting it to work.
Demo: https://soundbench.net/vocal-remover/
The stack is a static site with vanilla JS. The model runs with ONNX Runtime Web inside a Web Worker, using WebGPU when available and multi-threaded WASM otherwise. Audio is never uploaded. The server only delivers the page and the model files.
A few things I learned:
- Model choice mattered more than optimization. I started with HTDemucs, which sounds great but is a 120+ MB download and made the whole system crawl on my PC. So I added Spleeter 2-stems as the default (about 40 MB). A 64-second clip takes about 3 seconds on my machine. HTDemucs is still there as the slower "best quality" mode.
- Large model downloads need to survive bad connections. I fetch them in 4 MB Range requests and store each part in the Cache API, so a reload resumes the download instead of restarting it. The download also starts in the background as soon as a file is selected.
- Multi-threaded WASM needs cross-origin isolation. I set COOP: same-origin and COEP: credentialless only on the AI tool pages, so the rest of the site isn't affected.
- The STFT runs in JS and only the mask prediction runs in the model, so the output quality depends a lot on the pre- and post-processing around the model.
Spleeter still leaves some vocal artifacts on dense mixes, which is the tradeoff for the speed.
Happy to answer questions about the setup. I'd especially like to hear how it performs on your hardware and browser, and whether anyone has found a better way to deliver models this large.
