How do I convert a wav file to mp3 format using sox?
54,247
Solution 1
As an alternative (if all you need is to encode a Wave file to MP3) you can just use LAME to achieve the same results, for example:
lame -b 32 --resample 8 -a <wavefilename> <mp3filename>
LAME can be installed on CentOS painlessly using yum. You'll first need the RPMForge repository:
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Then:
yum install lame
Solution 2
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 :)
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on July 09, 2022Comments
-
Admin almost 2 years
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.
-
Scott over 13 yearsGuess one needs to figure out how to do that....
-
Scott over 13 yearsI read the article. What does one do if they already have the older version? I installed it using the dag repositories.... I'm new to linux.
-
Morgan over 9 yearsThank you so much. I tried to get sox working for forever and a half, but this just worked out of the box with no hassle. Saved me probably hours of trying to figure out why no one else's solutions worked for me.
-
dotancohen about 8 yearsDead link. Dead link.