Table of Contents

Ubuntu - Sound - Convert WAV to MP3

Using ffmpeg

ffmpeg -i "song.wav" -ab 320k "song.mp3"

Batch:

for i in *.wav; do ffmpeg -i "$i" -ab 320k "${i%.*}.mp3"; done
for i in *.wav; do ffmpeg -i "$i" -f mp3 "${i%}.mp3"; done

Mono to stereo conversion:

ffmpeg -i test.wav -af "pan=stereo|c0=c0|c1=c0" out.wav

Strip Video:

ffmpeg -i input.wav -vn -ar 44100 -ac 2 -b:a 192k output.mp3

Using Lame

High quality

lame -h song.wav song.mp3

Fixed 128kbs stereo encoding

lame song.wav song.mp3

Fast and low quality

lame -f song.wav song.mp3

Encode at a bit rate of 112 kbs

lame -b 112 song.wav song.mp3

Using Bladeenc

bladeenc song.wav song.mp3

NOTE: The size of the MP3 file will be approximately 10% the size of the WAV file.