Muse Python Libary: Compare the Audio Data in Two MP3 Files

One of the problems with MP3 files is that I tend to move them around and modify their tags. This often leads to my having two MP3 files with the same name, and not being sure whether they are the same song with different tags, or two different versions of the song (for example, a studio version and a live version).

I started hacking muse, a program to back up and restore music libraries to a network attached file server, writing in python to allow it to be run on either Windows or Linux. When I looked for a python library to let me compare the audio portions of two MP3 files, I found pydub on GitHub. Unfortunately, pydub extracts the audio by running an external program, ffmpeg. Desiring a portable solution, I decided to write my own library to allow me to compare the audio in two MP3 files.

The muse library defines the Mp3File object. You can compare two Mp3Files using the compareAudio method. Each file is only processed once, and an MD5 checksum stored in the object to improve the speed of future comparison operations.

You can find the latest version of muse on github:

About jimbelton

I'm a software developer, and a writer of both fiction and non-fiction, and I blog about movies, books, and philosophy. My interest in religious philosophy and the search for the truth inspires much of my writing.
This entry was posted in programming and tagged , , , . Bookmark the permalink.

Leave a Comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s