Speech & Audio AI Lab

Interactive labs for speech recognition, speech synthesis, and audio in general: in-browser DSP experiments, algorithms, datasets, and a learning path, without storing any recording.

43experiments

Speaker Diarization (Educational)

Speaker Diarization (Educational)

An educational experiment on splitting a clip into sub-segments and clustering them by MFCC similarity, on licensed or synthetic data. Do not use it to identify real people, and do not store voiceprints.

Advanced

Educational content in the form of a scientific draft that needs expert review before being adopted as an academic reference. No experimental result that was not actually run is shown here.

Prerequisites

  • Python with numpy, scipy and librosa
  • Licensed data used with the owners' consent
  • Commitment not to identify individuals or store embeddings

Tools

  • voice-activity-detection
  • mfcc-similarity
  • mfcc-explorer

Implementation Steps

  1. Detect speech segments with VAD
  2. Slice each segment into short windows
  3. Extract a representation for each window (mean MFCC, for educational purposes)
  4. Cluster the windows hierarchically
  5. Assign an anonymous label to each cluster (Speaker 1, 2)
  6. Compute DER on synthetic data with known boundaries
  7. Delete any temporary representations after the experiment

Code

JavaScript / PythonImplemented and Tested
import numpy as np, librosa
from scipy.cluster.hierarchy import fcluster, linkage
sr = 16000
t = np.arange(sr) / sr
segs = [np.sin(2*np.pi*f*t) for f in (200, 200, 800, 800, 200)]
F = np.array([librosa.feature.mfcc(y=s, sr=sr, n_mfcc=13).mean(axis=1) for s in segs])
labels = fcluster(linkage(F, 'average'), t=2, criterion='maxclust')
print(labels)  # anonymous cluster numbers, not identities

Expected Results

The segments of the two different tones are expected to separate into two clusters on the synthetic data, which does not mean the method is valid for real human voices.

These are educational expectations and not experimental results actually measured.

Project Tests

  • Compute DER on a synthetic signal with known boundaries
  • Observe the effect of window length on the segmentation
  • Verify that no embedding is written to disk

References

  1. Snyder, Garcia-Romero, Sell, Povey, Khudanpur. X-Vectors: Robust DNN Embeddings for Speaker Recognition. 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) (2018). DOI
  2. Desplanques et al.. ECAPA-TDNN: Emphasized Channel Attention, Propagation and Aggregation in TDNN Based Speaker Verification. arXiv (2020). DOI
  3. Nagrani et al.. VoxCeleb: a large-scale speaker identification dataset (2017). Source
  4. Ravanelli et al.. SpeechBrain: A General-Purpose Speech Toolkit. arXiv preprint (2021). DOI

Audio processing in the experiments takes place inside your browser. Audio, texts, and conversations are not saved on the server. Privacy Policy