3 # wma to mp3 script by mtron
4 # from http://ubuntuforums.org/showthread.php?t=37793
6 # have found that soundconverter package on ubuntu works on more types
7 # and is a bit more polished, but mtron's script kicks ass anyhow, if all
8 # you need is wma -> mp3 conversions.
12 --text="this script converts all wma files in the current folder
13 to mp3s and puts them in the folder output
15 all lame command line options can be set in the next step.
18 lame -m s: for stereo mp3 output
19 lame -m s V 3-4-5: for stereo mp3 output with VBR"
21 # Dialog box to choose output quality
22 FORMAT=$(zenity --list --title="Choose mp3 output quality" --radiolist --column="Check" --column="Quality (editable)" --editable "" "lame -m s" "" "lame -m s -V 3" "" "lame -m s -V 4" "" "lame -m s -V 5")
24 if [ $FORMAT -eq ""]; then
25 zenity --error --text="mp3 output quality not defined or no wma file found
28 lame -m s: for stereo mp3 output
29 lame -m s V 3-4-5: for stereo mp3 output with VBR
32 for all command line options "
40 # How many files to make the progress bar
42 NUMBER_OF_FILES=$(find -iname "*.wma")
43 let "INCREMENT=100/$NUMBER_OF_FILES"
46 (for i in *.wma; do mv "$i" $(echo $i | tr ' ' '_'); done
49 for i in *.[Ww][Mm][Aa]; do mv "$i" $(echo $i | tr '[A-Z]' '[a-z]'); done
51 #Rip with Mplayer / encode with LAME
54 echo "# Re-Coding $i";
55 mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader $i && $FORMAT audiodump.wav -o $i;
56 let "PROGRESS+=$INCREMENT"
60 for i in *.wma; do mv "$i" "$(basename "$i" .wma).mp3";
64 let "PROGRESS+=$INCREMENT"
65 ) | zenity --progress --title "$Recoding...encoding..." --percentage=0