Scott Klarr Jr
Linux: M4A to MP3 converter shell script
UPDATE!
I have written a much better shell program than the one posted below.
SKwizard - M4A to MP3 Converter & File Renaming Tool
Convert M4A To MP3 In Linux
This shell script is quite handy for converting a directory of .m4a sound files to .mp3's. This script requires that you have LAME and FAAD2 installed already.
Create a file called m4a2mp3 with the following source code:
#!/bin/bash
for i in *.m4a; do
echo "Converting: ${i%.m4a}.mp3"
faad -o - "$i" | lame - "${i%.m4a}.mp3"
done
You then need to make it executable, and move it to the /bin directory.
su
chmod +x m4a2mp3
mv m4a2mp3 /bin/
Now you can simply type m4a2mp3 in the shell and it will convert any M4A files contained within the current directory to MP3. The script does not delete the old m4a files, but that can be easily added to the script if you wanted.
Hint
When you are browsing your files with konqueror, you can hit F4 to bring up a console that is set the directory your currently viewing in konqueror. So if you navigate to a folder with some music files, all you will need to do is hit F4, then type m4a2mp3 and it will do its thing!
Last 5 Linkbacks
- Nov 08, 2009blog.onsendesigns.com
- May 28, 2009blog.luizagostinho.com
- Jan 08, 2009bibliotecadecrono.wordpress.com
- Jan 05, 2009www.mynetfaves.com
- Jan 14, 2008www.menekali.com



pragmattica Jan 16, 2008
This is definitely a handy script. The only problem with it is that it loses the artist and album tags. I wrote a script that performs the conversion and keeps some of the tag information from the M4A, in case you're interested:
http://pragmattica.wordpress.com/2008/01/17/convert-itunes-m4a-files-to-mp3-on-linux/
martin Feb 16, 2008
nice script.
you saved my day and the my songbird player
va1e Apr 28, 2008
Unable to find correct AAC sound track in the MP4 file. :(
va1e Apr 28, 2008
~$ mplayer -ao pcm file.m4a -ao pcm:file="file.wav"
it works better for me
Jameson Williams Apr 05, 2009
A useful and concise method, thanks.
Pykler Apr 11, 2009
You my friend are awesome.
Nathan Apr 12, 2009
I get a 'Warning: unsupported audio format' when I try to run your script... I installed LAME and FAAD2. Is there something else I should install?
Félix GG Aug 19, 2009
Merci beaucoup :-)
Thank you very much :-)
Jonas Dec 10, 2009
Thanks for the lovely script