← All models

audio-to-audio · music → stems · WASM · ~303 MB

Music source separation — split a song into stems

Upload a song and Demucs pulls it apart into four stems — vocals, drums, bass and everything else — right on your device. Mute the vocals for instant karaoke, solo them for an acapella, mix and match, and download each stem. The audio never leaves the tab.

The use cases, as real demos

Basics

The four-stem microscope: each real stem with waveform, measured energy/timing, play/stop/download, and what the model assigned.

Practical

The karaoke maker: play the backing without vocals, compare vocal/backing live, download a real mixed karaoke WAV.

Wild

The remix deck: real per-stem faders + mute pads and presets over the looping stems, then download your recombined mix.

Multi-model

Vocals → lyrics: Demucs hands the vocals stem to a Whisper ASR worker; the transcript (and the honest verdict) is real.

At a glance

ModelMrCitron/demucs-v4-onnx — Hybrid Transformer Demucs (htdemucs)
Taskaudio source separation (audio-to-audio)
Stems4: drums, bass, other, vocals
Input44.1 kHz stereo; the first ~7.8 s segment is separated per run
ArchitectureHybrid Transformer Demucs (waveform + spectrogram branches; STFT inside the graph)
Quantizationfp32 ONNX (run directly via onnxruntime-web)
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~303 MB, cached after first load
Licensecc-by-nc-4.0

Run it

Drop or choose an audio file (or try the sample song). The first ~7.8 seconds are separated into four stems in about ten seconds; then mix, mute and download them.

Drop a song, or:

Sample: “The CC BY Song” by loveshadow, additional lyrics by Victor Stone — CC BY 3.0, via ccMixter. The bundled file is the original upload, unmodified; the demo analyzes only the first ~7.8 s (the song sings from the first bar). Full credits: CREDITS.md.

Why it matters

Source separation is the magic behind karaoke tracks, remixes and sample-flipping. Doing it in the browser means you can pull the vocals out of a track — or isolate the drums — without uploading your music to anyone's server.

It separates the first ~7.8-second segment per run (Demucs works on fixed-length windows; a full song would be many segments). The vocals stem is trained on sung vocals — the bundled sample's verse isolates them (spoken word mostly lands in "other"). Quality on WASM matches the model; it's just slower than on a GPU.

How the API works

htdemucs takes a stereo waveform segment and returns four stems — the STFT lives inside the graph:

// onnxruntime-web, fp32
const input = new ort.Tensor("float32", stereo, [1, 2, 343980]); // 7.8 s @ 44.1 kHz
const { output } = await session.run({ input });
// output: [1, 4, 2, 343980] → [drums, bass, other, vocals]

We feed raw waveform and get waveform stems back (no manual spectrograms), decode/resample the file to 44.1 kHz stereo in the browser, and run the model in a Web Worker so the page stays responsive during the ~10 s separation.

References