M
MercyNews
Home
Back
From Unknown Artist to Custom Code: Building a Music Recognizer
Technology

From Unknown Artist to Custom Code: Building a Music Recognizer

Fifteen years of digital hoarding led to a weekend coding project: an asynchronous Python tool that bypasses rate limits and fixes encoding errors to identify thousands of mystery tracks.

Habr1d ago
3 min read
📋

Quick Summary

  • 1A developer faced a 15-year backlog of 12,000 untitled MP3 files that needed identification.
  • 2The solution was a custom-built music recognizer using Python and Shazam's API.
  • 3Key technical hurdles included bypassing rate limits and fixing corrupted file encodings.
  • 4The resulting code is open-source and designed to be memory-efficient.

Contents

The Mystery Track DilemmaA Weekend of CodeTechnical HurdlesThe Solution in ActionKey Takeaways

The Mystery Track Dilemma#

For over a decade, a digital library grew into a chaotic archive of 12,000 MP3 files. Each track was labeled simply as "Unknown Artist — Track 01," a testament to years of downloading and procrastinating on organization. This massive collection of untitled music represented a daunting digital cleanup project that seemed impossible to tackle manually.

The sheer volume of files made standard sorting methods ineffective. The owner realized that to reclaim this library, a more sophisticated approach was needed. This realization sparked a weekend-long coding marathon to build a custom solution from scratch, aiming to finally give every track its proper name.

A Weekend of Code#

The project's core objective was to create an asynchronous music recognizer using Python. By leveraging the Shazam API, the tool could query song identities without the manual effort of searching for each track individually. The developer dedicated a single weekend to writing the code, turning a long-standing problem into a focused, intensive development sprint.

The goal was not just identification, but also efficiency. The solution needed to process thousands of files without overwhelming system resources or hitting API restrictions. This required a carefully designed architecture that could handle a massive queue of audio files in parallel.

  • Process 12,000 MP3 files automatically
  • Integrate with the Shazam API for identification
  • Ensure the script runs within a single weekend
  • Make the final code open-source for others

Technical Hurdles#

Developing the recognizer presented several significant engineering challenges. The primary obstacle was navigating the API rate limiting imposed by the identification service. To avoid being blocked, the script had to intelligently manage request timing and spacing. Additionally, the collection contained numerous files with corrupted or non-standard encodings, which required a robust pre-processing step to ensure the audio data could be read correctly.

Perhaps the most critical constraint was memory management. Loading a massive queue of files simultaneously could easily exhaust system RAM. The developer engineered the tool to be memory-efficient, processing files in a controlled stream rather than in bulk. This ensured stability and allowed the entire operation to complete successfully.

How to bypass rate limiting, fix broken encodings, and avoid consuming all memory.

The Solution in Action#

The final tool operates as a streamlined pipeline. First, it scans the directory of untitled MP3s, reading each file's audio signature. It then formats these signatures for the Shazam API, sending requests asynchronously to maximize throughput. The script is designed to gracefully handle errors, such as unreadable files or API timeouts, logging them for review without halting the entire process.

As tracks are successfully identified, the tool can update the file metadata, transforming "Unknown Artist — Track 01" into "Actual Artist — Actual Song Title." This automated process converts a chaotic folder into a searchable, organized music library. The developer has made the code publicly available, allowing others with similar digital hoarding problems to benefit from the solution.

Key Takeaways#

This project demonstrates how a targeted coding effort can solve a personal but widespread problem: digital disorganization. By building a custom tool, the developer successfully processed a 15-year collection of music in a single weekend, proving the power of automation. The open-source release of the code provides a valuable resource for the developer community.

The initiative highlights several important principles for software development:

  • Directly address personal pain points with custom tools
  • Anticipate and engineer solutions for API limitations
  • Prioritize memory efficiency in data-heavy applications
  • Share successful solutions with the open-source community

Frequently Asked Questions

The developer addressed the issue of organizing 12,000 untitled MP3 files. Over 15 years, a digital library had accumulated with generic names like 'Unknown Artist — Track 01,' making it impossible to navigate manually.

The tool was built using Python, leveraging an asynchronous framework to handle multiple requests. It integrated with the Shazam API to identify song titles and artist names for the unlabeled audio files.

The project required overcoming three key hurdles: bypassing API rate limits to avoid being blocked, fixing various audio file encoding errors, and ensuring the script operated without consuming excessive system memory.

Yes, the developer has made the code for the music recognizer open-source. This allows other developers and music enthusiasts to use or adapt the tool for their own unorganized music libraries.

#музыка#распознавание музыки#python#песочница#аудио#diy

Continue scrolling for more

AI Transforms Mathematical Research and Proofs
Technology

AI Transforms Mathematical Research and Proofs

Artificial intelligence is shifting from a promise to a reality in mathematics. Machine learning models are now generating original theorems, forcing a reevaluation of research and teaching methods.

Just now
4 min
211
Read Article
Salvador's Summer Arts & Music Guide: Top Events
Entertainment

Salvador's Summer Arts & Music Guide: Top Events

From the energetic rehearsals of Timbalada to the sophisticated sounds of Chico César, Salvador's summer calendar is packed with cultural highlights. Discover the must-see events, free concerts, and major festivals lighting up the city.

20m
7 min
6
Read Article
Apple's AI Ambitions and Card Controversies Unveiled
Technology

Apple's AI Ambitions and Card Controversies Unveiled

A deep dive into the latest tech headlines, from Apple's strategic moves in artificial intelligence to the evolving narrative around its financial services.

22m
5 min
6
Read Article
Netanyahu Urges Trump to Delay Iran Strike
Politics

Netanyahu Urges Trump to Delay Iran Strike

Amid rising tensions, reports suggest Israeli Prime Minister Benjamin Netanyahu has asked President Donald Trump to hold off on striking Iran. The request comes as Tehran halts executions and the IDF remains on high alert.

35m
5 min
6
Read Article
Democrats Accuse SEC of Selective Crypto Enforcement
Politics

Democrats Accuse SEC of Selective Crypto Enforcement

House Democrats have accused the SEC of selectively enforcing laws against crypto firms, while spotlighting Tron founder Justin Sun.

41m
5 min
6
Read Article
Natural Cycles Unveils Smart Wristband for Birth Control App
Technology

Natural Cycles Unveils Smart Wristband for Birth Control App

The FDA-cleared birth control app Natural Cycles is launching a dedicated wristband to replace traditional thermometers, offering continuous sleep tracking for fertility monitoring.

41m
5 min
7
Read Article
Meta's Layoffs Leave Supernatural Fitness Users in Mourning
Technology

Meta's Layoffs Leave Supernatural Fitness Users in Mourning

Users of the VR fitness service are distraught that Supernatural has had its staff cut and won’t receive any more content updates. They’re also pissed at Meta.

43m
5 min
6
Read Article
US-Taiwan $500B Semiconductor Deal: A New Trade Era
Economics

US-Taiwan $500B Semiconductor Deal: A New Trade Era

A landmark agreement between the United States and Taiwan promises to inject over $500 billion into American semiconductor manufacturing, fundamentally altering the global technology landscape and trade dynamics.

44m
5 min
6
Read Article
Tokyo Broadcasting System Acquires Stake in Legendary Entertainment
Economics

Tokyo Broadcasting System Acquires Stake in Legendary Entertainment

Tokyo Broadcasting System has made a strategic investment in Legendary Entertainment, the producer of 'Dune' and the Godzilla franchise, that will allow the Hollywood company access to more Japanese intellectual property.

48m
5 min
12
Read Article
Why Senior Engineers Let Bad Projects Fail
Technology

Why Senior Engineers Let Bad Projects Fail

A deep dive into the complex reasons why experienced engineers sometimes choose not to intervene in failing projects, examining the professional calculus behind these difficult decisions.

54m
5 min
6
Read Article
🎉

You're all caught up!

Check back later for more stories

Back to Home