7 from eyed3.mp3 import Mp3AudioFile
10 def id3tag_recode(value):
12 return value.encode(dst_encoding)
13 except UnicodeEncodeError:
14 return value.encode('latin1')
16 def printFrame(title, frame):
18 print '%s: %s' % (title, frame)
20 def printFramesList(title, frames):
21 frames = [frame for frame in frames if frame]
23 print '%s: %s' % (title, ', '.join(frames))
25 def printTrack(title, frame):
29 print '%s: %d (of %d)' % (title, track, total)
31 print '%s: %d' % (title, track)
33 print '%s: UNKNOWN of %d' % (title, total)
36 print "File:", filename
37 mp3_file = Mp3AudioFile(filename)
39 id3tag = mp3_file.getTag()
43 for version in eyed3.id3.ID3_V2, eyed3.id3.ID3_V1:
44 id3tag = eyed3.id3.tag.Tag()
45 if not id3tag.parse(filename, version):
48 images = id3tag.images