Skip to content

Instantly share code, notes, and snippets.

View JasonSpine's full-sized avatar
🕹️
GameDev

Marek Adamczyk JasonSpine

🕹️
GameDev
View GitHub Profile
@JasonSpine
JasonSpine / mp3s_overall_time.py
Created January 23, 2017 09:02
Get overall time of all mp3s in the current directory
import os,commands,re
path = './' # the directory path to calc
listing = os.listdir(path) # list all files
result=0 # result [seconds]
for i in listing:
if i[-4:].lower()==".mp3": # check the file extension
command = "ffmpeg -i '%s' 2>&1 | grep Duration"%i
durationString=commands.getoutput(command)