
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.