Post tagged: music

Do They Fit?

Do you want to know if the MP3s in that folder will fit on a CD?

No problem.

#!/usr/bin/env python

import audioread
import sys

try:
    files = sys.argv[1:]
except:
    print('Usage: %s <files/glob>' % (sys.argv[0],))
    sys.exit()

total_length = 0.0
for file in files:
    f …