Q: Need a little command line trickery in order to convert a bunch of .wav files to .mp3 using LAME
I have a bunch of .wav files that I would like to convert to .mp3 using the LAME encoder.
I've already installed the LAME encoder and all the .wav files are in the same directory.
Can someone help me with a little command line trickery?
MacBook Pro with Retina display, OS X Mountain Lion (10.8.2)
Posted on Dec 2, 2012 10:54 AM
by Bidit Mazumder,Solvedanswer
If you want high quality VBR (-V0) with a minimum allowed bitrate of 96 kbps (-b 96) and the output files resampled to 48 kHz (--resample 48), use the following:
for i in *.wav; do j=`echo "$i.mp3" | cut -d . -f 1,3`; lame -b 96 -V0 --resample 48 "$i" "$j"; done
Posted on Dec 2, 2012 1:52 PM