sherpa-onnx speaker diarization (WebAssembly)
Prebuilt WebAssembly assets for fully on-device speaker diarization ("who spoke when"), redistributed for the TranscriptAI / FileWhirl on-device audio features so they can be fetched with CORS at runtime and cached in the browser. No audio leaves the device.
These are the unmodified prebuilt artifacts from sherpa-onnx v1.13.7 (k2-fsa),
speaker-diarization WASM target. The pipeline is pyannote-segmentation-3.0 (ONNX) +
a speaker-embedding model + agglomerative clustering, all inside the wasm module. The
models are baked into the .data preload.
Files
sherpa-onnx-wasm-main-speaker-diarization.js/.wasm/.dataโ the Emscripten buildsherpa-onnx-speaker-diarization.jsโ the JS API wrapper (createOfflineSpeakerDiarization)
Usage
Load the three scripts (define Module = {} with onRuntimeInitialized first), then:
const sd = createOfflineSpeakerDiarization(Module); const segments = sd.process(float32Mono16k);
Each segment is { start, end, speaker } (seconds, integer cluster id).
Attribution & licenses
- sherpa-onnx โ Apache-2.0, k2-fsa: https://github.com/k2-fsa/sherpa-onnx (source release v1.13.7)
- pyannote/segmentation-3.0 โ MIT: https://huggingface.co/pyannote/segmentation-3.0
- Speaker-embedding model โ WeSpeaker / 3D-Speaker; VoxCeleb-trained weights are CC-BY-4.0 (attribution required for redistribution / commercial use).
Redistributed under the above terms with attribution.