Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thisismattmiller/af339ef7e27e7ca79801eb12e258d103 to your computer and use it in GitHub Desktop.
Save thisismattmiller/af339ef7e27e7ca79801eb12e258d103 to your computer and use it in GitHub Desktop.
import glob
import subprocess
import os
for file in glob.glob('data/*'):
output = file.replace('data/','').split('.')
output = output[0] + '.mp3'
print(file,'-->',output)
if os.path.exists(f'converted/{output}'):
print("SKIPPPPP")
continue
process = subprocess.Popen(f"ffmpeg -i {file} -vn -ar 44100 -ac 2 -b:a 192k converted/{output}", shell=True, stdout=subprocess.PIPE)
process.wait()
print(process.returncode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment