pandora_cdosea/gongs_wav.py
2017-10-02 13:37:53 +02:00

12 lines
323 B
Python
Executable file

#!/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])