audio-classification · 27M causal BSRNN + ECAPA-TDNN512 · WASM fp16 · 49.84 MB · Apache-2.0

VoxLock v2: Target-Speaker Voice Isolation

VoxLock v2 (arbazsiddiqui/voxlock, 27M parameters, Apache-2.0) locks onto one enrolled speaker from a 5-second voice sample (extracting the loudest 3.0 s window via enroll_fp16.onnx) and strips background bystander voices with a causal Band-Split RNN (chunk_fp16.onnx, 24 ms algorithmic latency) entirely on CPU WebAssembly.

At a glance

VoxLock v2 model specifications and browser runtime contract
Source model arbazsiddiqui/voxlock (Apache-2.0 · 27M params · causal 6-layer Band-Split RNN TSE_BSRNN_SPK fine-tuned from REAL-TSE with WeSpeaker ECAPA_TDNN_GLOB_c512 speaker encoder)
Browser ONNX weights onnx/v2/enroll_fp16.onnx (10.89 MB = 10,893,975 B) + onnx/v2/chunk_fp16.onnx (38.95 MB = 38,947,947 B) = 49.84 MB decimal (fp16 matches fp32 to >70 dB; 4.95% Krisp WER, 0.11 leaked background words/min)
Task & runtime Catalogue task: audio-classification (upstream HF audio-to-audio target-speaker extraction) · CPU wasm via isolated onnxruntime-web@1.21.0 in a dedicated module Web Worker
I/O contract 16 kHz mono Float32Array PCM · Enrollment input [1, 48000] (3.0 s voiced span selected from 5.0 s capture) → { enroll_n, k, v } · Causal chunk input (512-pt window, 128-sample / 8 ms hop, persistent LSTM h/c [6, 32, 256]) + -0.5 polarity/gain calibration
Web APIs WebAssembly, Module Web Workers, Cache Storage, Web Audio / AudioContext, MediaRecorder (optional mic enrollment), Canvas 2D — Baseline widely available

Why target-speaker isolation differs from generic denoisers: Single-channel denoisers like GTCRN suppress stationary noise (fans, hum, hiss) but keep every human voice in the room. VoxLock v2 conditions its 32-band causal separator on a specific speaker's ECAPA-TDNN voiceprint (enroll_n, k, v), silencing interfering human bystanders while keeping the enrolled caller intact.

1 · 5-Second Enrollment & Target-Speaker Isolation

Reused ledgered repo audio only (zero duplicate audio files): Speaker A = JFK inaugural address (20 Jan 1961, public domain, via models/whisper-speech-to-text/jfk.wav) and Speaker B = LibriSpeech test-clean 61-70968-0000 (Paul-Gabriel Wiener, CC BY 4.0 · credits), mixed deterministically in-memory with calibrated crosstalk & ambience — or upload/record your own audio below.

Initialise VoxLock v2 (49.84 MB fp16 CPU WASM) above to enroll a target speaker and isolate crosstalk locally.

1 · Enrollment Sample (5s → loudest 3.0 s)

Loading speaker sample…

2 · Before · Room Mix (Caller + Bystander)

Preparing mixture…

3 · After · VoxLock Isolated Caller

Run VoxLock isolation to audition isolated output.

Bystander Cut–
Target Corr–
SI-SNR Gain–
Enroll · Chunk–
RTF · Chunks–
Runtime · NaN–

2 · See inside: Speaker Embedding Tensors & 50 ms Frame Energy

onnx/v2/enroll_fp16.onnx projects the loudest 3.0 s voiced window (48,000 samples) into three voiceprint conditioning tensors: normalized spectral TF-map enroll_n [257, 376] plus ECAPA cross-attention keys k [32, 2, 64, 298] and values v [32, 2, 298, 64]. Each causal 100-frame chunk of chunk_fp16.onnx carries 6-layer Band-Split LSTM states h/c [6, 32, 256] across time, attenuating frames where only the bystander speaks.

enroll_n tensor–
Cross-attn k–
Cross-attn v–
Voiceprint Window–

Why VoxLock v2 matters

Voice agents, live captions, and call transcribers break down whenever a colleague, television, or café neighbor talks near the microphone. Running arbazsiddiqui/voxlock locally in 49.84 MB CPU WebAssembly removes interfering speakers before ASR or turn-taking hears them — with zero audio leaving the device and Apache-2.0 freedom.

3 · Use-case ladder

4 · How the ONNX Runtime Web API works

import * as ort from "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.21.0/dist/ort.wasm.min.mjs";

const enrollSess = await ort.InferenceSession.create(enrollFp16Bytes, { executionProviders: ["wasm"] });
const chunkSess  = await ort.InferenceSession.create(chunkFp16Bytes,  { executionProviders: ["wasm"] });

// 1. Extract voiceprint conditioning tensors from 3.0 s (48,000 samples @ 16 kHz)
const { enroll_n, k, v } = await enrollSess.run({
  enroll: new ort.Tensor("float32", enroll3sPcm, [1, 48000]),
});

// 2. Stream causal 100-frame chunks with persistent LSTM states h, c [6, 32, 256]
const res = await chunkSess.run({ wav: chunkTensor, enroll_n, k, v, h, c });
// Overlap-add res.frames with Hann² window and multiply by -0.5 for exact polarity & level.

5 · Inspect worker & enrollment DSP code

Show the code · worker.js — ensureLoaded() (epoch-guarded Cache Storage & ORT Web fp16 init)
Show the code · worker.js — isolateSpeaker() (ECAPA enrollment + streaming causal BSRNN loop)
Show the code · voxlock-core.mjs — fitVoxLockEnrollment() (loudest 3.0 s voiced window selector)