Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Identifies a song from a small recording (say 30 seconds). The song has to be a part of your created database, of course.
This project is essentially a simplified version of what Shazam does.
The flowchart on the right describes the series of steps.
Below is a brief summary. For detailed explanation with analysis, check out our Report.
We decimate the audio signal by a factor of 4 after passing it through a low pass filter (to smartly avoid aliasing). Thereafter, the signal is converted to frequency domain using the famous Fast Fourier Transform.
We take small chunks of the sample (roughly 0.3 seconds) and take the peak frequencies along a logarithmic scale. Those values are then associated with a hash value. We do so for all the songs and hence create a database.
We perform similar steps for the recorded sample. The answer is the song with the highest number of matches for a particular offset value.
pip install Presto-Chango
presto-chango create-db <songs-directory>
# Record in real time
presto-chango identify
# Use a pre-recorded sample
presto-chango identify --file=samples/sample1.wav
$ presto-chango identify --file="samples/sample_GAY.wav"
Loading database
.
.
.
Database loaded
Processing...
Results:
Kane Brown - Good as You (Official Music Video)_mS3TeZEp_PE.wav 41
Katy Perry - Never Really Over (Official)_aEb5gNsmGJ8.wav 39
Ed Sheeran - Perfect (Official Music Video)_2Vv-BfVoq4g.wav 37
Cody Johnson - On My Way To You (Official Music Video)_RKUENGsDXBA.wav 24
Jason Aldean - Rearview Town_WEUUvntknTI.wav 23
git clone https://github.com/yashrajkakkad/presto-chango.git
cd presto-chango
python -m venv venv
source venv/bin/activate
--editable
flag makes it so that we don't have to reinstall everytime we make some change.pip install --editable .
You can run the tester code if you're too lazy to record songs. It will cut random 30 second samples from songs and run the algorithm.
python tester.py
FAQs
Music identification through audio fingerprinting
We found that Presto-Chango demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.