A CLI music recognition tool for audio and mixtapes.
Project description
Pyzam is a free CLI music recognition tool for audio and mixtapes in Python.
Installation
Dependencies
Pyzam requires ffmpeg installed.
Installation
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
# 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 Sample Limit per request
The maximum sample duration that Shazam allows is 12 seconds. Any audio after 12 seconds will not be recieved by Shazam.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyzam-0.12.2.tar.gz
(10.6 kB
view details)
Built Distribution
pyzam-0.12.2-py3-none-any.whl
(10.0 kB
view details)
File details
Details for the file pyzam-0.12.2.tar.gz
.
File metadata
- Download URL: pyzam-0.12.2.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22503e510469de6e354a56f5385f80e09ba101dbe0bb1c8518a339f105624dff |
|
MD5 | b75be93808d9179f5e87428aa2b18832 |
|
BLAKE2b-256 | 329661399bac65c34546a8533a9e82347716735748f1e4fb0ad5f22045034405 |
File details
Details for the file pyzam-0.12.2-py3-none-any.whl
.
File metadata
- Download URL: pyzam-0.12.2-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 596fc7570e4f72ddbbf6966232b90f8f0a7638a8dc4cf0a4eebd0c1497222bad |
|
MD5 | c8886c39c2baf45d05ff68523763fc76 |
|
BLAKE2b-256 | 16a6420f899e56ef86ad41f7fd2f0455dc60c5d0ae2977ba6dfecb5c31d2dc53 |