I mixdown and store my audio projects in WAV format. For several projects I needed to batch convert my WAV files to specific MP3 formats. In this article I’ll explain how you can do batch conversion from WAV to MP3 from the terminal window.
Open a Terminal window and go to the folder that is holding your audio files. Now enter (you can copy and paste of course) one of the following commands:
If you want the output in Stereo:
for f in *.wav; do lame -b 320 -q 0 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -b 256 -q 0 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -b 196 -q 0 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -b 160 -q 0 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -b 128 -q 0 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -b 112 -q 0 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -b 96 -q 0 “$f” “${f%.wav}.mp3”; done
If you want to force the output to Mono:
for f in *.wav; do lame -m m -b 320 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -m m -b 256 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -m m -b 196 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -m m -b 160 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -m m -b 128 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -m m -b 112 “$f” “${f%.wav}.mp3”; done
for f in *.wav; do lame -m m -b 96 “$f” “${f%.wav}.mp3”; done
For example:
$ cd Audio/Wanderen/Ready4Conversion
$ for f in *.wav; do lame -m m -b 128 “$f” “${f%.wav}.mp3”; done
The example above converts all audio files in the folder “Audio/Wanderen/Ready4Conversion” to 128 bit Mono MP3 files.
Suggestions for improving this article are welcome, please let me know and drop me a line .