Batch convert M4A to MP3

M4A, is an audio coding format developed by Apple Inc. for lossless data compression of digital music. Late 2011 Apple made the codec available open source and royalty-free. In this article I’ll explain how you can easily convert M4A audio files to MP3 files from the terminal window.

Open a Terminal window and go to the folder that is holding your M4A audio files. Now copy and paste the following command:

for f in *.m4a; do ffmpeg -i “$f” -acodec libmp3lame -ab 320k “${f%.m4a}.mp3”; done

For example:
$ cd Audio/Wanderen/Ready4Conversion
$ for f in *.m4a; do ffmpeg -i “$f” -acodec libmp3lame -ab 320k “${f%.m4a}.mp3”; done

The example above converts all M4A audio files in the folder “Audio/Wanderen/Ready4Conversion” to MP3 files.

Suggestions for improving this article are welcome, please let me know and drop me a line .