Pyzam is a free CLI music recognition tool for audio and mixtapes in Python.
Installation
Dependencies
Pyzam requires ffmpeg installed.
Installation
Using uv (recommended):
uv tool run pyzam --speaker
Using pip:
$ pip install pyzam
Using environment.yml with Conda (installs ffmpeg for you):
conda env create -n pyzam --file=environment.yml
conda activate pyzam
Usage
Using uv:
uv tool run pyzam --speaker
Using pip:
# Listen to speaker (5 seconds by default)
pyzam --speaker
# Listen to microphone
pyzam --microphone
# Listen to audio files
pyzam --input audio_file.mp3
# Listen to audio via URL
pyzam --url "https://archive.org/download/09-hold-me-in-your-arms/02%20-%20Never%20Gonna%20Give%20You%20Up.mp3"
# Loop the recognition continously and save the logs as CSV file
pyzam --speaker -d 10 --write --loop
# Listen to mixtapes and save the logs as CSV file
pyzam --input audio_file.mp3 --duration 12 --mixtape
See pyzam --help for more options.
Options
| Argument name | Description |
|---|---|
| --input | Detects from the given audio input file. |
| --microphone, -m | Listens to the microphone of your device. |
| --speaker, -s | Listens to the speaker of your device (default). |
| --url, -u | Detects from the given URL to an audio file. |
| --help, -h | Show usage, options and exit. |
| --duration, -d | Length of microphone or speaker recording. Max = 12 seconds. |
| --quiet, -q | Supresses the operation messages (i.e. Recording speaker for X seconds...). |
| --loop, -l | Loop the recognition process indefinitely. |
| --mixtape | Detects every -d seconds for a given input file, only works with --input. --write is enabled automatically. |
| --json, -j | Return the whole Shazamio output in JSON. |
| --write, -w | Writes the output of as a CSV file. |
Known Limitations
Shazam API Call Limit (Error 429)
Shazam allows up to 20 requests per minute. Hence, a proxy is recommended to speed up recognition when using --mixtape.
12 Second Duration Limit per request
The maximum sample duration that Shazam allows is 12 seconds. Any audio after 12 seconds will not be recieved by Shazam.
Metadata
Release files for Pyzam 0.13.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyzam-0.13.2.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyzam-0.13.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.9 kB
Release files / pyzam-0.13.2.tar.gz
| Download URL | pyzam-0.13.2.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89b013b72b90178212880b3ceb1569a70dd6c37bb09d7c434b7ffb4523c99091
|
|
BLAKE2b-256 checksum How to use checksums |
7a66ebebfa088330dcf8f34167f948cfdf5c520c78e365a6c5d97c3547a5a50e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.13
|
Release files / pyzam-0.13.2-py3-none-any.whl
| Download URL | pyzam-0.13.2-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4dcd1b4b4a29f60012795944e626a19f9e3d6c2abc88343c1ae788ff1ad4bdb7
|
|
BLAKE2b-256 checksum How to use checksums |
cbade5b6f3de1696170e8d838486df713a406d158a362e332e376ab50e837d78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.13
|