Multi-model · PyAnnote 3.0 (6.0 MB) + WeSpeaker ResNet34-LM (6.69 MB) · ~12.7 MB Total

End-to-End Browser Diarization & Voiceprint Clustering

PyAnnote segmentation-3.0 alone finds local speech turns within short windows, but needs a speaker embedding model to link returning speakers consistently across a full recording. Here Stage 1 segments speech turns in 6.0 MB and Stage 2 (WeSpeaker ResNet34-LM, 6.69 MB) embeds every turn into a 256-d x-vector and clusters them into global speaker identities — 100% on CPU WASM.

1. Two Independent On-Device Models (~12.7 MB Combined)

True PyAnnote 3.1 architecture in the browser: Both models run in separate Web Workers with independent lifecycle controls. Release either stage at any time without losing the other stage's output or flashing false errors.

Stage 1 · PyAnnote Segmentation 3.0 (6.0 MB WASM fp32)

Stage 2 · WeSpeaker ResNet34-LM (6.69 MB WASM q8 · CC-BY-4.0)

Loading stitched multi-speaker conversation…

Preparing 16 kHz mono audio…

2. Aligned Speaker Timeline & Agglomerative Clustering

Stage 1 turns–
Clustered speakers–
Within-speaker cos–
Cross-speaker cos–
Stage 1 / Stage 2 ms–

Turn-by-Turn Clustered Transcript Slots

Detected speech turns with Stage 1 PyAnnote IDs and Stage 2 WeSpeaker clustered speaker labels
Turn Window Stage 1 Stage 2 Cluster Centroid cos
Run the pipeline above to segment turns and assign global speaker identities.

Clustered Speaker Summary

Global speaker clusters with turn counts, talk time, and mean cosine coherence
Speaker Turns Talk time Mean cos
Awaiting Stage 2 WeSpeaker clustering…

3. Agglomerative Voiceprint Clustering Code

Show the code · wespeaker-core.mjs — agglomerativeCluster()