Sunday, November 30, 2014

Installing Mutagen

As you have seen in previous post that it has used mutagen library for parsing mp3 and reading ID3 tags. Another powerful library for same purpose is eyed3 but relatively difficult to use in a Windows environment therefore mutagen was obvious choice.

I performed following steps to use mutagen in my python codes:

1. Downloaded latest tarball from lazka
2. Unzipped it and went inside to the folder ..\mutagen-1.27\dist\mutagen-1.27\mutagen-1.27 where I found setup.py
3. Made sure that python is available in system path env variable in windows
4. Build it with the command = python setup.py build
5. After build it created a build folder under ..\mutagen-1.27\dist\mutagen-1.27\mutagen-1.27 directory, inside which there was a lib folder and inside which I found the compiled mutagen folder structure.
6. Copied this mutagen folder structure inside ../build/libs directly into c:\python27 directory
7. Tried to execute the following code that went successful after the steps above:

from mutagen.id3 import ID3

audio_file_location = "audioFiles/Sleep Away.mp3"
audio_handler = ID3(audio_file_location)
print (audio_handler['TIT2'][0] )


Resources:



1 comment: