This is a reproducible compiled Core ML export of
speechbrain/spkrec-ecapa-voxceleb.
It produces a local voice embedding for cosine-similarity speaker comparison.
The graph includes sentence mean normalization. Audio-to-mel processing stays
outside the graph so apps can share one tested streaming frontend between Core
ML and MLX.
The official source reports 0.80% equal-error rate on the cleaned VoxCeleb1
test set. That upstream result is not presented as a new benchmark for this
conversion. Before changing a speaker-verification threshold, validate the
compiled artifact on VoxCeleb1-O and the microphones and languages used by the
product.
Speaker embeddings are not secure biometric authentication and do not protect
against replay or synthesized-voice attacks.
1import coremltools as ct
2import soundfile as sf
3
4from frontend import compute_fbank
5
6model = ct.models.CompiledMLModel("SpeechBrainECAPAVoxCeleb.mlmodelc")
7audio, sample_rate = sf.read("voice.wav", dtype="float32")
8assert sample_rate == 16000 and audio.ndim == 1
9mel = compute_fbank(audio, 80)[None, :, :]
10embedding = model.predict({"mel_features": mel})["embedding"]
The exact periodic Hamming window, symmetric SpeechBrain mel filters, decibel
conversion, and frame limits are recorded in config.json.