5

Hello so here is the deal, I used:

$ yum install sox 

To install it in CentOS 6. After that I did a quick test:

$ sox test.mp3 test.amr

and this is what it returns:

$ sox formats: no handler for file extension `mp3'

I need this done with sox not lame because I will need to use it for mixing and other functions not available with lame.

  • In a Cygwin environment, install packages sox-fmt-ao and sox-fmt-pulseaudio. – Abdull Apr 17 '16 at 19:24
3

The vanilla version of sox on CentOS doesn't support the mp3 codec. Here's a list of what it does support.

$ sox
...
AUDIO FILE FORMATS: 8svx aif aifc aiff aiffc al amb au avr caf cdda cdr cvs cvsd
cvu dat dvms f32 f4 f64 f8 fap flac fssd gsm gsrt hcom htk ima ircam la lpc 
lpc10 lu mat mat4 mat5 maud nist ogg paf prc pvf raw s1 s16 s2 s24 s3 s32 s4 s8 
sb sd2 sds sf sl smp snd sndfile sndr sndt sou sox sph sw txw u1 u16 u2 u24 u3 
u32 u4 u8 ub ul uw vms voc vorbis vox w64 wav wavpcm wv wve xa xi
PLAYLIST FORMATS: m3u pls
AUDIO DEVICE DRIVERS: alsa ao oss ossdsp pulseaudio

You can download the source RPM of sox and recompile with libmad and lame-devel libraries installed to add support for this feature.

This tutorial should help, titled: INSTALLING SOX W/ MP3 SUPPORT ON CENTOS 5.X, though it's for CentOS 5.x it should still apply. There are also steps in the comments of that post for compiling sox with mp3 support on CentOS 6.x.

Steps

From the comments.

The one-stop solution for CentOS 6.4 without mad or libid3tag (YMMV):

### as root

$ yum install -y sox lame    
$ mkdir /usr/local/src/SoX
$ cd /usr/local/src/SoX
$ wget http://downloads.sourceforge.net/project/sox/sox/14.4.1/sox-14.4.1.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsox%2Ffiles%2Fsox%2F14.4.1%2F&ts=1366019279&use_mirror=freefr
$ tar -xvzf sox-14.4.1.tar.gz
$ cd sox-14.4.1/
$ ./configure
$ make -s
$ make install
$ echo “include /usr/local/lib” >> /etc/ld.so.conf
$ /sbin/ldconfig

Repo #1 - RPM Fusion

To be able to install lame you'll need to add an additional YUM Repo to your mix. The repo that contains lame is called RPM Fusion. At the time that I'm writing this the latest version of the RPM that will install the RPM Fusion repo is at: rpmfusion-nonfree-release-6-1.noarch. To install it:

$ sudo rpm -ivh http://download1.rpmfusion.org/nonfree/el/updates/6/x86_64/rpmfusion-nonfree-release-6-1.noarch.rpm

NOTE: You may need an RPM signing keys, specifically this one for EL6.

Repo #2 - EPEL

Installing the RPM Fusion repo requires another YUM repo called EPEL - Extra Packages for Enterprise Linux. You'll need to install this RPM as well, priror to installing RPM Fusion's RPM.

$ sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

NOTE: The version number on this repo changes from time to time so it's best to check what the lastest one is. Currently at the time of this post the latest version was 6.8. You can see these numbers in the package name above, "epel-release-6-8.noarch.rpm".

References

  • when I do yum install lame, it returns package not found.it says sox installed.but no lame package lame available. – cppit Nov 2 '13 at 8:46
  • @fogsy - have you ever recompiled a RPM package before? – slm Nov 2 '13 at 8:50
  • yes I did recompile sox actually just today – cppit Nov 2 '13 at 8:58
  • Using a source RPM or did you just download the tar.gz file for the sox package and compile that? I'd try the updates I added, if you're stuck or that approach doesn't work, I noticed in the RPM Fusion repo a package that appears to be an MP3 enabled version of sox: sox-plugins-nonfree. This is a source RPM for Fedora but can be rebuilt for CentOS 6. – slm Nov 2 '13 at 9:03
  • tar gz the same way you wrote on your answer - thanks for your help btw. this is what adding the new yum repo returned : warning: /var/tmp/rpm-tmp.jWYeuB: Header V3 RSA/SHA256 Signature, key ID 5568bbb2: NOKEY error: Failed dependencies: epel-release >= 6 is needed by rpmfusion-nonfree-release-6-1.noarch rpmfusion-free-release >= 6 is needed by rpmfusion-nonfree-release-6-1.noarch – cppit Nov 2 '13 at 9:05
0

It can be solved esaily with

yum install sox soxr sox-plugins-freeworld -y

sox-plugins-freeworld include mp3 support.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.