Created
May 17, 2019 01:53
-
-
Save thisismattmiller/af339ef7e27e7ca79801eb12e258d103 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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