how to check the length of each mp3
I want it as h:m:s format
So this is what i did
import mutagen
from glob import glob
import time
def mp3LengthList(files):
'''list->list
'''
s=[]
for i in files:
m = mutagen.File(i)
s.append(m.filename + " : " + secondsToPrint( float(m.info.length) ) )
return s
def secondsToPrint(seconds):
return time.strftime("%H:%M:%S", time.gmtime(seconds))
f = glob("../Richard Dawkins/The Selfish Gene - 1976/*.mp3")
No comments:
Post a Comment