Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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