-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Maybe cache the info within the abook folder?
Sample code for mp3:
#!/usr/bin/python
import glob
from mutagen.mp3 import MP3
files = glob.glob ('*.mp3')
myTotal = 0
def fix_time( seconds ):
hours = int(seconds) / 3600
seconds = seconds % 3600
minutes = int(seconds) / 60
seconds = seconds % 60
seconds = int(seconds)
return "%d:%02d:%02d" % (hours, minutes, seconds)
for eachfile in files:
audio = MP3(eachfile)
eachTime = fix_time( audio.info.length )
print("File: %s - Length: %s" % (eachfile, eachTime))
myTotal = myTotal + audio.info.length
newTotal = fix_time( myTotal )
print("Total time: %s" % (newTotal))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels