M
MercyNews
Home
Back
From Unknown Artist to Custom Code: Building a Music Recognizer
Технологии

From Unknown Artist to Custom Code: Building a Music Recognizer

Habr22h ago
3 мин чтения
📋

Key Facts

  • ✓ The project was initiated to organize a personal collection of 12,000 MP3 files that had accumulated over 15 years.
  • ✓ The developer built an asynchronous recognizer using Python and the Shazam API to automate the identification process.
  • ✓ A primary technical challenge involved bypassing API rate limits to process the thousands of files without being blocked.
  • ✓ The script was specifically designed to be memory-efficient, preventing system crashes while handling a large volume of data.
  • ✓ The entire coding solution was developed over a single weekend, turning a long-standing procrastination project into a finished tool.
  • ✓ The final code was made open-source, providing a blueprint for others facing similar digital organization challenges.

In This Article

  1. The Mystery Track Dilemma
  2. A Weekend of Code
  3. Technical Hurdles
  4. The Solution in Action
  5. Key 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
#музыка#распознавание музыки#python#песочница#аудио#diy

Continue scrolling for more

ИИ преобразует математические исследования и доказательства
Technology

ИИ преобразует математические исследования и доказательства

Искусственный интеллект перешел из статуса непостоянного обещания в реальность, преобразуя математические исследования. Модели машинного обучения теперь генерируют оригинальные теоремы.

Just now
4 min
211
Read Article
Iran’s Crypto Economy Hit $7.8 Billion in 2025 as Protests Fueled Bitcoin Use: Chainalysis
Cryptocurrency

Iran’s Crypto Economy Hit $7.8 Billion in 2025 as Protests Fueled Bitcoin Use: Chainalysis

Iran’s crypto activity accelerated in 2025, a new report says, driven by civilians and state actors turning to Bitcoin during periods of unrest.

13m
3 min
0
Read Article
Болсонару приказано перевести в тюремный комплекс Папуда
Politics

Болсонару приказано перевести в тюремный комплекс Папуда

Бразильский судья приказал немедленно перевести бывшего президента Жаира Болсонару из штаба федеральной полиции в тюремный комплекс Папуда для обеспечения более благоприятных условий содержания.

26m
5 min
6
Read Article
Стратегический набор OpenAI в лаборатории Thinking Machines Lab
Technology

Стратегический набор OpenAI в лаборатории Thinking Machines Lab

OpenAI планирует набрать дополнительных исследователей из лаборатории Thinking Machines Lab после найма двух сооснователей. Это сигнализирует об эскалации конкуренции за таланты в ИИ-индустрии.

31m
5 min
6
Read Article
Венесуэла заявляет о дипломатической непокорности США
Politics

Венесуэла заявляет о дипломатической непокорности США

Венесуэла заняла твердую позицию в дипломатических отношениях с США. Исполняющий обязанности президента Дельси Родригес заявила, что страна не боится дипломатического противостояния.

31m
5 min
6
Read Article
США получили инвестиции в чипы на 250 миллиардов долларов от Тайваня
Politics

США получили инвестиции в чипы на 250 миллиардов долларов от Тайваня

США заключили торговое соглашение с Тайванем, снижая пошлины на тайваньские товары в обмен на инвестиции тайваньских компаний в размере 250 миллиардов долларов в строительство заводов по производству чипов на территории США.

33m
5 min
6
Read Article
16 января: Глобальные праздники и культурные вехи
Culture

16 января: Глобальные праздники и культурные вехи

16 января отмечается во всем мире как день, объединяющий профессиональные традиции, музыкальное наследие и религиозные празднования.

40m
3 min
6
Read Article
Необычное использование Trump'ом Stardew Valley в политическом дискурсе
Politics

Необычное использование Trump'ом Stardew Valley в политическом дискурсе

Администрация Trump'а опубликовала скриншот из игры Stardew Valley в социальной сети, используя его для комментария на тему возможного третьего президентского срока. Этот шаг продолжает тенденцию использования игровых отсылок в политических сообщениях.

40m
5 min
6
Read Article
Dexter: Resurrection 2-й сезон запустит новый студийный комплекс в Манхэттене
Entertainment

Dexter: Resurrection 2-й сезон запустит новый студийный комплекс в Манхэттене

Manhattan's Sunset Pier 94 Studios подписала первый арендный контракт с Paramount Television Studios для съемок 2-го сезона сериала «Dexter: Resurrection». Производство займет 70 000 квадратных футов.

44m
5 min
6
Read Article
За мифом о биткоин-лотерее: объяснение непомеченных блоков
Cryptocurrency

За мифом о биткоин-лотерее: объяснение непомеченных блоков

Серия непомеченных блоков Bitcoin вызвала шквал спекуляций о победе соло-майнера. NiceHash объяснил, что это было внутреннее тестирование, а не чудесный выигрыш.

45m
5 min
6
Read Article
🎉

You're all caught up!

Check back later for more stories

На главную