How do I convert a wav file to mp3 format using sox?

john picture john · Jun 25, 2009 · Viewed 51.2k times · Source

When I run sox directly from the command line as ;

sox -r 8000 -c 1 <wavfilename> <mp3filename>

I get the following error message:

sox: Unknown output file format for '747a.mp3': File type 'mp3' is not known

My machine is running the CentOS operating system.

Answer

Jeremy Smyth picture Jeremy Smyth · Jun 25, 2009

You'll need to install an appropriate MP3 encoder, e.g. LAME, or recompile Sox with liblame support.

This is independent of your Perl programming :)