用yum安装的sox是不支持mp3的。如果需要支持mp3,需要自己编译:
cd /usr/local/src
yum install autoconf-archive
git clone git://git.code.sf.net/p/sox/code sox
cd sox
autoreconf -i
yum install libmad-devel
./configure
make
make install
如果需要其它codec的支持,可以看下INSTALL,或查阅官方文档。
SoX should compile and run on any POSIX compatible system (Linux, BSD,
Solaris, Xcode on Mac OS X, Cygwin on MS-Windows, etc.). For other
compilers/systems, it is often possible to manually construct a custom
`soxconfig.h' and `Makefile' for that system (the minimum requirements
are 32-bit CPU, 64-bit FPU, C89 compiler).
Note that the `play', `rec', and `soxi' programs are in fact just
copies-of or links-to (depending on OS) `sox'.
SoX optionally makes use of some external libraries to obtain support
for additional file formats and/or effects. Optional libraries should
be installed before compiling SoX. The current list of supported
libraries, where to get them (if not from your OS distribution), and
their licence types, is as follows:
OpencoreAMR-NB/WB http://sourceforge.net/projects/opencore-amr Apache
VisualOn AMR-WB http://sourceforge.net/projects/opencore-amr Apache
AO http://xiph.org/ao GPL
FLAC http://flac.sourceforge.net BSD
LADSPA http://www.ladspa.org LGPL + plugins' licence
Lame MP3 encoder http://lame.sourceforge.net LGPL
Twolame MP2 enc. http://www.twolame.org LGPL
libltdl http://www.gnu.org/software/libtool LGPL
MAD MP3 decoder http://www.underbit.com/products/mad GPL
MP3 ID3 tags http://www.underbit.com/products/mad GPL
Magic http://www.darwinsys.com/file BSD
Ogg Vorbis http://www.vorbis.com BSD
Opus http://www.opus-codec.org/ BSD
PNG http://www.libpng.org/pub/png zlib (BSD-like)
Sndfile http://www.mega-nerd.com/libsndfile LGPL
WavPack http://www.wavpack.com BSD