Last active
August 29, 2015 14:03
-
-
Save hlin117/7fb04b47a08d48eeaeb6 to your computer and use it in GitHub Desktop.
A quick gist to convert wma files in a folder to mp3 files. Uses the command line tool ffmpeg.
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
#!/usr/bin/python | |
import os | |
for file in os.listdir("."): | |
if file.endswith("wma"): | |
name = file[:-4] | |
command = "ffmpeg -i '{0}.wma' '{0}.mp3' -y".format(name) | |
os.system(command) |
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
#!/bin/bash | |
while IFS= read -u 4 -r LINE; do | |
ffmpeg -i "$LINE" "${LINE%.*}.mp3" -y | |
done 4< <(exec find "." -type f -name '*.wma') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment