A library for creating and comparing voice biometrics using GMM models.
Project description
pyometrics
A Python library for creating and comparing voice biometrics using Gaussian Mixture Models (GMMs). You can train a biometric model from a set of audio files and then compare new samples against that model to get a similarity score.
Features
- MFCC + Delta Feature Extraction
- GMM Training via scikit-learn
- User-Defined Minimum Required Audio Files (min_files)
- Supports .wav, .mp3, .m4a, .flac by default
Installation
Install from PyPI:
pip install pyometrics
Usage
- Train (or create) a voice biometric:
from pyometrics import create_voice_biometric
create_voice_biometric(
folder_path="path/to/audio/folder",
model_path="my_biometric.gmm",
min_files=5 # specify how many audio files must exist
)
- The library expects at least
min_filesaudio files in the folder. - The GMM model is saved to the file
my_biometric.gmm.
- Compare a new audio sample:
from pyometrics import compare_voice_biometric
score = compare_voice_biometric(
audio_path="path/to/new_audio.mp3",
model_path="my_biometric.gmm"
)
print("Similarity Score (log-likelihood):", score)
- A higher (less negative) log-likelihood indicates closer similarity.
Example
Suppose you have at least 10 .mp3 files of the same speaker in samples_for_biometric/. You can do:
from pyometrics import create_voice_biometric, compare_voice_biometric
create_voice_biometric(
folder_path="samples_for_biometric",
model_path="example.gmm",
min_files=10
)
score = compare_voice_biometric(
audio_path="test_sample.m4a",
model_path="example.gmm"
)
print("Score:", score) # The higher, the more similar
Requirements
- Python 3.6+
- librosa
- numpy
- scikit-learn
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyometrics-0.1.1.tar.gz.
File metadata
- Download URL: pyometrics-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b91c6486b7c3ad4e9817dadbdf91fa52d0bca3da0393bb38dd44ad22ce4716f
|
|
| MD5 |
f6f8235c5e15e63eca616b5be97d8d6d
|
|
| BLAKE2b-256 |
75c19777a18e8473be5946b518dd69c14d29e89407ca0083339c1b87a30b6206
|
File details
Details for the file pyometrics-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyometrics-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b232c716548efcf393c2b3bf92c753dead1b990e8b72bac5b34821c62f29c147
|
|
| MD5 |
15d2e2a9c6f10f7291f9c7b1c2b556d0
|
|
| BLAKE2b-256 |
cc3de64f24479a8924a50231ec5e490c8eeec18e4bbe05ae9245c4dcc1c0e529
|