mutagen

how to correct the misencoded string?

i used mutagen to read the mp3 metadata, since the id3 tag is read in as unicode but in fact it is GBK encoded. how to correct this in python? audio = EasyID3(name) title = audio["title"][0] print title print repr(title) produces µ±Äã¹Âµ¥Äã»áÏëÆðË­ u'\xb5\xb1\xc4\xe3\xb9\xc2\xb5\xa5\xc4\xe3\xbb\xe1\xcf\xeb\xc6\xf0\xcb\xad' but in ...

Reading file data during form's clean method

So, I'm working on implementing the answer to my previous question. Here's my model: class Talk(models.Model): title = models.CharField(max_length=200) mp3 = models.FileField(upload_to = u'talks/', max_length=200) Here's my form: class TalkForm(forms.ModelForm): def clean(self): super(TalkForm, self).clean(...

Determine MP3 bit depth in Python via Mutagen

Is there a way to determine an MP3 file's encoded bit depth (ie 8, 16, 24, 32) in Python using the Mutagen library? ...

Change embedded image type in APIC ID3 tag via Mutagen

I have a large music library which I have just spent around 30 hours organizing. For some of the MP3 files, I embedded the cover art image as type 0 (Other) and I'd like to change it to type 3 (Front Cover). Is there a way to do this in Python, specifically in Mutagen? ...

Mutagen's OggFileType producing 'Type Error: NoneType' exception

Ive just started using mutagen and have succefully used it with m4a, mp3, ape, afs, and flac. However Im having difficulty with the OggFileType class, when I try to create an instance of OggFileType Im presented with a "TypeError: 'NoneType' object is not callable" exception. Iv searched and searched for solutions but information and do...

Does anyone have good examples of using mutagen to write files?

Just as the question asks - does anyone have a good example of using the Mutagen python ID3 library to write mp3 files? I'm looking in particular to add disc/track number information, but examples editing the title and artist would be helpful as well. Cheers, /YGA ...