Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I know there are options such as Sound Converter for doing them one track or directory at a time, but are there any tools that will recursively crawl through a directory's subdirectories and convert all WMA's to MP3's?

I basically would like to let it loose on my ~/Music and let it do its thing without me manually having to give it one subdirectory at a time.

share|improve this question
As of note, if any WMA files have DRM on them, no Linux application will be able to decrypt them. –  Broam Aug 1 '11 at 15:01
add comment

3 Answers

up vote 3 down vote accepted

mplayer is likely to be on your install already, and make sure you have lame, then here are two ways to do it, an easy to read version, and a short and dirty script to do it:

All wma's should be in your current directory. Create a file called wmamp3 in your home directory (~/) containing:


current_directory=$( pwd )

#remove spaces
for i in *.wma; do mv "$i" `echo $i | tr ' ' '_'`; done

#remove uppercase
for i in *.[Ww][Mm][Aa]; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done

#Rip with Mplayer / encode with LAME
for i in *.wma ; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm -waveheader $i && lame -m s audiodump.wav -o $i; done

#convert file names
for i in *.wma; do mv "$i" "`basename "$i" .wma`.mp3"; done

chmod +x ~/wmamp3 to make it executable

sudo cp ~/wmamp3 /usr/bin to pop it somewhere useful on your path

Type "wmamp3" to run your conversion.

The short and dirty version (does exactly the same as above):

for i in *.wma ; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm -waveheader "$i" && lame -m j -h --vbr-new -b 160 audiodump.wav -o "`basename "$i" .wma`.mp3"; done; rm -f audiodump.wav
share|improve this answer
Thanks, but I need one that goes through directories recursively, since they're spread out through many subdirectories of ~/Music. –  Mike Crittenden Aug 1 '11 at 15:00
You can easily expand the script to do a recursive file hunt - I'd probably redo that first script using find, piping the output to mplayer. –  Rory Alsop Aug 1 '11 at 15:04
This answer isn't working for me in 2013. However this answer works: askubuntu.com/a/55469/36661 –  MountainX Aug 4 '13 at 2:21
add comment

Install Soundconverter Install soundconverter

and run Soundconverter from launcher or terminal

enter image description here

The default conversion is .ogg change this to mp3 going to edit-> preferences under type of results. Format to MP3 as follow:

enter image description here

Click on add folder and then select your music folder. You may select the output folder on the above preference configuration before you clicking on convert.

Hope this will be done by two clicks :)

share|improve this answer
This is certainly simple point and click. +1 from me :-) –  Rory Alsop Aug 1 '11 at 15:04
The problem with this solution is that SoundConverter performs extremely slowly or just freezes completely when more than a couple hundred songs are added at once, and my library has around 5k. –  Mike Crittenden Aug 1 '11 at 15:19
5k? wooo that is a lot ;) anyway it depends on your computer performance. may be you have to separate those files. personal i converted a couple of hundred songs without any freezes :) –  Achu Aug 2 '11 at 13:26
add comment

"Recursive WMA to MP3 script" in Google has come up with this

# By Marko Haapala
# converts wma to mp3 recursively. does not delete any static files, so 
# cleanup and renaming is needed afterwards. 
# requirements:
# lame    - http://lame.sourceforge.net/download.php
# mplayer - apt-get install mplayer or http://www.mplayerhq.hu/design7/dload.html

wma_files=$(find "${current_directory}" -type f -iname "*.wma")
# Need to change IFS or files with filenames containing spaces will not
# be handled correctly by for loop
for wma_file in ${wma_files}; do 
    mplayer -vo null -vc dummy -af resample=44100 \
    -ao pcm -ao pcm:waveheader "${wma_file}" && lame -m s \
    audiodump.wav -o "${wma_file}".mp3
    rm audiodump.wav

Looks like it does exactly what you want. Bear in mind you may want to fiddle with the lame flags to ensure you get the desired quality level.

share|improve this answer
This still works well in 2013 –  MountainX Aug 4 '13 at 2:21
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.