Created
June 6, 2015 16:17
-
-
Save tassoevan/02e7a25a958d7bdfd7ff to your computer and use it in GitHub Desktop.
A script to convert a file in Windows Media Audio format to MP3
This file contains hidden or 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 | |
# We need mplayer | |
if [ -z `which mplayer` ]; then | |
sudo apt-get install mplayer | |
fi | |
# We need lame | |
if [ -z `which lame` ]; then | |
sudo apt-get install lame | |
fi | |
if [ -z "$1" ]; then | |
echo "usage: $0 <wmafile>" >&2 | |
exit 1 | |
fi | |
wmafile="$1" | |
wavfile=`mktemp` | |
mp3file="${wmafile%.*}.mp3" | |
mplayer -vo null -vc dummy -af resample=44100 -ao pcm -ao pcm:waveheader -ao pcm:file="$wavfile" "$wmafile" | |
lame -m s "$wavfile" -o "$mp3file" | |
rm "$wavfile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment