pandora_cdosea/gongs_wav.py

13 lines
323 B
Python
Raw Normal View History

2017-10-02 11:37:53 +00:00
#!/usr/bin/python3
from glob import glob
import subprocess
import os
for f in glob('gongs/*/*.mp3'):
t = f.replace('gongs/', 'gongs_wav/').replace('.mp3', '.wav')
print(f, t)
folder = os.path.dirname(t)
if not os.path.exists(folder):
os.makedirs(folder)
subprocess.call(['ffmpeg', '-i', f, t])