MP3Detective: AI-Powered Music Metadata Manager
I have a huge collection of MP3 files for Hindi songs, and most of them have incorrect or missing metadata (like song name, artist, album, etc.). I tried many online tools but none of them worked well, especially for old Bollywood songs.
So, I decided to build my own tool using OpenAI's GPT-4o model. And... say hello to MP3Detective – a Python tool that automatically finds and updates MP3 metadata.
How it works
The tool is quite simple. You just:
- Put your MP3 files in the
input
folder - Run the Python script
- Get your updated files in the
output
folder
The best part? It works with any language or music genre. I tested it with my old Hindi songs collection, and it worked with about 95% accuracy. Yes, it did make some mistakes with very old or rare songs, but that's expected.
I also have a quick video showing how it works:
Building the tool
I used Python to build this tool because it has great libraries for handling MP3 files. The main pieces are:
- OpenAI's GPT-4o for identifying song details
eyeD3
for reading/writing MP3 tagstqdm
for showing nice progress bars
Here's the folder structure of how everything is placed:
mp3detective/
├── .gitignore # Git ignore rules
├── app.py # Main application file
├── requirements.txt # Python dependencies
├── README.md # This documentation
├── input/ # Place your MP3 files here
└── output/ # Updated files will appear here
The tool creates a copy of your original files, so you don't lose anything. It also keeps a detailed log of what it's doing, which helps if something goes wrong.
Real-world testing
I tried it with about 1,500 old Hindi songs first. Here's what I found:
- For most songs, it found the correct details
- Some very old songs (1950s-60s) were tricky
- Sometimes it couldn't decide between two similar song versions
- The original files stayed safe in the input folder
And this is what it shows in the terminal after the process finishes.
Using it yourself
Want to try it? It's pretty simple:
- Get the code from GitHub
- Install Python if you don't have it
- Add your OpenAI API key
- Put your MP3 files in the input folder
- Run the script
That's it! The tool will do its magic and you'll find your updated files in the output folder.
The code is open source, so feel free to try it out or even make it better!
Comment via email