26 releases

0.3.4 Sep 7, 2025
0.3.3 Sep 7, 2025
0.3.1 Jun 21, 2025
0.3.0 Dec 13, 2024
0.1.9 Aug 7, 2024

#655 in Audio

Download history 41/week @ 2025-09-21 44/week @ 2025-09-28 61/week @ 2025-10-05 33/week @ 2025-10-12 70/week @ 2025-10-19 220/week @ 2025-10-26 61/week @ 2025-11-02 45/week @ 2025-11-09 32/week @ 2025-11-16 27/week @ 2025-11-23 18/week @ 2025-11-30 59/week @ 2025-12-07 100/week @ 2025-12-14 197/week @ 2025-12-21 152/week @ 2025-12-28 55/week @ 2026-01-04

508 downloads per month

MIT license

23KB
300 lines

pyannote-rs

Crates License

Pyannote audio diarization in Rust

Features

  • Compute 1 hour of audio in less than a minute on CPU.
  • Faster performance with DirectML on Windows and CoreML on macOS.
  • Accurate timestamps with Pyannote segmentation.
  • Identify speakers with wespeaker embeddings.

Install

cargo add pyannote-rs

Usage

See Building

Examples

See examples

How it works

pyannote-rs uses 2 models for speaker diarization:

  1. Segmentation: segmentation-3.0 identifies when speech occurs.
  2. Speaker Identification: wespeaker-voxceleb-resnet34-LM identifies who is speaking.

Inference is powered by onnxruntime.

  • The segmentation model processes up to 10s of audio, using a sliding window approach (iterating in chunks).
  • The embedding model processes filter banks (audio features) extracted with knf-rs.

Speaker comparison (e.g., determining if Alice spoke again) is done using cosine similarity.

Credits

Big thanks to pyannote-onnx and kaldi-native-fbank

Dependencies

~8–12MB
~148K SLoC