No project description provided
Project description
Stain
Fast audio fingerprinting for Python
Install
pip install music-stain
Usage
fp = music_stain.PyFingerprinter()
hashes = fp.fingerprint_file("song.wav")
for h in hashes:
print(f"{h.hash} @ {h.time}")
API
PyFingerprinter() - Create fingerprinter
.fingerprint_file(path) -> list[PyHash] - Returns fingerprint hashes
PyHash
.hash: int - Fingerprint hash value
.time: int - Time offset (frames)
Matching Example
Build database:
db = {}
for h in fp.fingerprint_file("song.wav"):
db.setdefault(h.hash, []).append(("song_id", h.time))
Match query:
matches = {}
for h in fp.fingerprint_file("query.wav"):
if h.hash in db:
for song_id, db_time in db[h.hash]:
offset = db_time - h.time
matches[(song_id, offset)] = matches.get((song_id, offset), 0) + 1
best = max(matches.items(), key=lambda x: x[1])
print(f"Matched: {best[0][0]} with {best[1]} hits")
Formats
WAV, MP3, FLAC, OGG, M4A, etc.
License
MIT
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 Distributions
Built Distributions
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 music_stain-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: music_stain-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b33b12f6c294a3144b3f90da881c293f87054db0119ab2bd509887030de59d62
|
|
| MD5 |
7f1eeb2b16b5ba92ad30a9196c4d25a2
|
|
| BLAKE2b-256 |
852f96b9cff30ec7e1197a3165a9d651adea600c37b04b0dca906076ecfa3cab
|
File details
Details for the file music_stain-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: music_stain-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b5e9db96e692fa0b5cddc1fa53e94cd42b0dc385196d2de6294c01fabaa8076
|
|
| MD5 |
2cdd9cccb7b5562b3a067aba926bcbe6
|
|
| BLAKE2b-256 |
016ba2e423437d653b1f347ff95b9166a8b9f619be47f86920d071c3dfb8c08d
|
File details
Details for the file music_stain-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: music_stain-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f1fbf2491ffd2411a656a97d19b873a86a2d215f56b5b1a87952b7fb36f5ca2
|
|
| MD5 |
3866c43bbaf424e2ebac7769b48d9fe2
|
|
| BLAKE2b-256 |
635628919a422bbfbed639e676a374bf3c0214c233cda24b2143e775c4266b85
|
File details
Details for the file music_stain-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: music_stain-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f29f489febacb161d99bc5c3cd03322df010d702ed680ebca392058a9f493952
|
|
| MD5 |
74e9931ac6ea6c859d7c6a1eeb8cc20e
|
|
| BLAKE2b-256 |
c8bb0e06985bee08d0fb80917d2e53024bb24f139c010882c664cce4dbce19a6
|