Views
No views yet
1import SpeechVAD
2
3// Voice Activity Detection
4let vad = try await PyannoteVADModel.fromPretrained()
5let segments = vad.detectSpeech(audio: samples, sampleRate: 16000)
6for seg in segments {
7 print("Speech: \(seg.startTime)s - \(seg.endTime)s")
8}
9
10// Speaker Diarization (with WeSpeaker embeddings)
11let pipeline = try await DiarizationPipeline.fromPretrained()
12let result = pipeline.diarize(audio: samples, sampleRate: 16000)
13for seg in result.segments {
14 print("Speaker \(seg.speakerId): \(seg.startTime)s - \(seg.endTime)s")
15}python3 scripts/convert_pyannote.py --token YOUR_HF_TOKEN --upload(low_hz, band_hz) parameter pairs[O, I, K] → [O, K, I] for MLX channels-lastbias_ih + bias_hh| PyTorch Key | MLX Key | Shape |
|---|---|---|
sincnet.conv1d.0.filterbank.* (computed) | sincnet.conv.0.weight | [80, 251, 1] |
sincnet.conv1d.{1,2}.weight | sincnet.conv.{1,2}.weight | [O, K, I] |
sincnet.norm1d.{0-2}.* | sincnet.norm.{0-2}.* | varies |
lstm.weight_ih_l{i} | lstm_fwd.layers.{i}.Wx | [512, I] |
lstm.weight_hh_l{i} | lstm_fwd.layers.{i}.Wh | [512, 128] |
lstm.bias_ih_l{i} + bias_hh_l{i} | lstm_fwd.layers.{i}.bias | [512] |
lstm.*_reverse | lstm_bwd.layers.{i}.* | same |
linear.{0,1}.* | linear.{0,1}.* | varies |
classifier.* | classifier.* | [7, 128] |