Friday, April 28, 2006
Sound Libraries and Codecs
The Cool Pick Of The Day is the following Open Source Sound Libraries. With the below installed sound libraries, many great sound applications and utilities can be harnessed. As time goes on, I will update this entry to include even more libraries, that way, future C.P.O.T.D. posts will just need to point to this blog entry for sound support references. You should be able to install all of them without any issues. Even if you have these libraries installed already in the standard locations, these will be installed in the /usr/local area so that shouldn't negatively affect your existing install base- but keep that in mind. No promises, but I will do my best. I might even include a blog entry to show how to reinstall the C.P.O.T.D. libraries and applications as these libraries are updated by their maintainers.
Each one of these sound packages deserves a C.P.O.T.D. award and I will continue to add informational details on each one. There are a lot of them, so I will do it gradually over time.
In order to maximize your computer's audio capability, you should install some utilities, codecs and libraries, mpg321, libao, ogg vorbis, libmad, LAME, port audio, flac, speex, theora, jackd, sox, ecasound, and mplayer, to name quite a few.
The Libraries
MAD is an open-source GPL (and commercial license is available as well) MPEG audio decoder. It currently supports MPEG-1, 2 and "2.5". All 3 audio layers (I,II,III) are fully implemented. It supports neither MPEG-2 multichannel audio nor does it currently support AAC yet.
A few interesting aspects of libmad is that it supports 24-bit PCM output (e.g. exceptionally high quality audio), it is written using only 32-bit fixed-point (integer) computation (good for non-floating-point architectures!!!) and based on the ISO/IEC standards.
#libmad http://www.underbit.com/products/mad/
cd /tmp
wget ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz
tar zxf libmad-0.15.1b.tar.gz
cd libmad-0.15.1b
./configure
make
paco -lp libmad-0.15.1b "make install"
Libao is an opensource cross-platform audio library that provides a simple API to allow programs to output audio. Currently it currently supports: Null output (for testing without a sound device), WAV files, AU files; numerous sound architectures such as OSS (Open Sound System), ALSA (Advanced Linux Sound Architecture), polypaudio (next generation GNOME sound server), esd (EsounD or Enlightened Sound Daemon) and NAS (Network Audio Server)
#libao http://www.xiph.org/ao/
cd /tmp
wget http://downloads.xiph.org/releases/ao/libao-0.8.6.tar.gz
tar zxf libao-0.8.6.tar.gz
cd libao-0.8.6
./configure
make
paco -lp libao-0.8.6 "make install"
ldconfig
#libid3tag http://www.underbit.com/products/mad/
cd /tmp
wget ftp://ftp.mars.org/pub/mpeg/libid3tag-0.15.1b.tar.gz
tar -zxf libid3tag-0.15.1b.tar.gz
cd libid3tag-0.15.1b/
./configure
make
paco -lp libid3tag-0.15.1b "make install"
ldconfig
#mpg321 http://mpg321.sourceforge.net/
cd /tmp
wget http://superb-east.dl.sourceforge.net/sourceforge/mpg321/mpg321-0.2.10.tar.gz
tar zxf mpg321-0.2.10.tar.gz
cd mpg321-0.2.10
./configure
make
paco -lp mpg321-0.2.10 "make install"
#libsndfile http://www.mega-nerd.com/libsndfile/
cd /tmp
wget http://www.mega-nerd.com/libsndfile/libsndfile-1.0.16.tar.gz
tar zxf libsndfile-1.0.16.tar.gz
cd libsndfile-1.0.16
./configure
make
paco -lp libsndfile-1.0.16 "make install"
ldconfig
#LAME http://lame.sourceforge.net/
cd /tmp
wget http://internap.dl.sourceforge.net/sourceforge/lame/lame-3.97b2.tar.gz
tar zxf lame-3.97b2.tar.gz
cd lame-3.97
./configure
make
paco -lp lame-3.97 "make install"
ldconfig
#id3lib http://id3lib.sourceforge.net/
cd /tmp
wget http://easynews.dl.sourceforge.net/sourceforge/id3lib/id3lib-3.8.3.tar.gz
tar zxf id3lib-3.8.3.tar.gz
cd id3lib-3.8.3
./configure
make
paco -lp id3lib-3.8.3 "make install"
ldconfig
FLAC (Free Lossless Audio Codec) FLAC is a compression audio standard similar to MP3, but differs from MP3 in that it is compressed without any loss in quality. FLAC works like any other lossless compression method (zip, gz, sit,etc) but since it is designed specifically for audio so the compression ratio is superior to other general purpose lossless compression methods. FLAC is the only free lossless audio compression codec that has hardware support.
The encoding FLAC utilizes is very robust. It has 16-bit CRC's per frame to detect transmission errors while streaming and has an additional MD5 signature of the original audio data stored in the file header as an additional integrity check. This error resistant encoding scheme limits the damage to the frame that the error occurred in which allows for a data stream not to be completely corrupted even by a large block of corruption within the data stream. The resilience is also enhanced by the fact that each frame is not dependant on the preceding or succeeding frames since it contains all it needs for decompression within the frame. This is nice because that allows decoders to pick up when the stream is no longer being corrupted and to not quit processing the remainder of the stream (this would be important if you wished to get as much of the valid stream data as possible even when there was corruption dispersed throughout it.)
The FLAC files are seekable which allows for index positioning which is great for end-user playback as well as for audio editing applications. The format allows for metadata types to be embedded within the FLAC file and currently contains metadata types for tags, cue sheets (e.g. storing a CD table of contents, all track and index points), and seek tables. Additionally, new metadata blocks can be defined and implemented in future versions of FLAC without the worry of breaking older streams or decoders.
FLAC is an open source, "freely" available (modified BSD license) codec library that is supported on many operating systems: *nix (Linux, *BSD, OS X, Solaris, and IRIX), BeOS, MS Windows OS/2, and Amiga.
#flac http://flac.sourceforge.net/
cd /tmp
wget http://superb-east.dl.sourceforge.net/sourceforge/flac/flac-1.1.2.tar.gz
tar zxf flac-1.1.2.tar.gz
cd flac-1.1.2
./configure
make
paco -lp flac-1.1.2 "make install"
ldconfig
#libogg http://www.vorbis.com/
cd /tmp
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
tar zxf libogg-1.1.3.tar.gz
cd libogg-1.1.3
./configure
make
paco -lp libogg-1.1.3 "make install"
ldconfig
#libvorbis http://www.vorbis.com/
cd /tmp
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
tar zxf libvorbis-1.1.2.tar.gz
cd libvorbis-1.1.2
./configure
make
paco -lp libvorbis-1.1.2 "make install"
ldconfig
Speex is a "gratis" and patent free Open Source Software audio compression format designed specifically for speech (speech coder) whose licensing is the Xiph.org variant of the BSD license.
Speex is based on what is called Code Excited Linear Prediction (CELP) and can compress voice at bit rates ranging from 2 to 44 kbps. Speex's features include: Intensity stereo encoding; Variable bit rate operation (VBR); Voice Activity Detection (VAD); Discontinuous Transmission (DTX); 8 kHz, 16 kHz, and 32 kHz compression in the same bit stream; and Packet loss concealment.
#speex http://www.speex.org/
cd /tmp
wget http://downloads.xiph.org/releases/speex/speex-1.0.5.tar.gz
tar zxf speex-1.0.5.tar.gz
cd speex-1.0.5
./configure
make
paco -lp speex-1.0.5 "make install"
ldconfig
#vorbis-tools http://www.vorbis.com/
cd /tmp
wget http://downloads.xiph.org/releases/vorbis/vorbis-tools-1.1.1.tar.gz
tar zxf vorbis-tools-1.1.1.tar.gz
cd vorbis-tools-1.1.1
./configure
make
paco -lp vorbis-tools-1.1.1 "make install"
ldconfig
#libtheora http://www.theora.org/
cd /tmp
wget http://downloads.xiph.org/releases/theora/libtheora-1.0alpha5.tar.gz
tar zxf libtheora-1.0alpha5.tar.gz
cd libtheora-1.0alpha5
./configure
make
paco -lp libtheora-1.0alpha5 "make install"
ldconfig
#portaudio http://www.portaudio.com/
wget http://www.portaudio.com/archives/portaudio_v18_1.zip
unzip portaudio_v18_1.zip
cd portaudio_v18_1
make -f Makefile.linux
paco -lp portaudio_v18_1 "make -f Makefile.linux libinstall; cp pa_common/portaudio.h /usr/local/include"
ldconfig
#jackd http://jackit.sourceforge.net/
wget http://superb-west.dl.sourceforge.net/sourceforge/jackit/jack-audio-connection-kit-0.100.0.tar.gz
tar zxf jack-audio-connection-kit-0.100.0.tar.gz
cd jack-audio-connection-kit-0.100.0
./configure
make
paco -lp jack-audio-connection-kit-0.100.0 "make install"
ldconfig
#sox http://sox.sourceforge.net/
wget http://superb-east.dl.sourceforge.net/sourceforge/sox/sox-12.17.7.tar.gz
tar zxf sox-12.17.7.tar.gz
cd sox-12.17.7
./configure
make
paco -lp sox-12.17.7 "make install"
#ecasound http://eca.cx/ecasound/
cd /tmp
wget http://ecasound.seul.org/download/ecasound-2.4.3.tar.gz
tar zxf ecasound-2.4.3.tar.gz
cd ecasound-2.4.3
./configure
make
paco -lp ecasound-2.4.3 "make install"
ldconfig
#mplayer http://www.mplayerhq.hu/design7/news.html
mkdir /tmp/mplayer
cd /tmp/mplayer
wget http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0pre7try2.tar.bz2
wget ftp://ftp1.mplayerhq.hu/MPlayer/releases/codecs/essential-20050412.tar.bz2
tar jxf MPlayer-1.0pre7try2.tar.bz2
cd MPlayer-1.0pre7try2
./configure
make
paco -lp MPlayer-1.0pre7try2 "make install"
mkdir /usr/local/lib/codecs
cd /usr/local/lib/codecs/
tar jxf /tmp/mplayer/essential-20050412.tar.bz2
Each one of these sound packages deserves a C.P.O.T.D. award and I will continue to add informational details on each one. There are a lot of them, so I will do it gradually over time.
In order to maximize your computer's audio capability, you should install some utilities, codecs and libraries, mpg321, libao, ogg vorbis, libmad, LAME, port audio, flac, speex, theora, jackd, sox, ecasound, and mplayer, to name quite a few.
The Libraries
MAD is an open-source GPL (and commercial license is available as well) MPEG audio decoder. It currently supports MPEG-1, 2 and "2.5". All 3 audio layers (I,II,III) are fully implemented. It supports neither MPEG-2 multichannel audio nor does it currently support AAC yet.
A few interesting aspects of libmad is that it supports 24-bit PCM output (e.g. exceptionally high quality audio), it is written using only 32-bit fixed-point (integer) computation (good for non-floating-point architectures!!!) and based on the ISO/IEC standards.
#libmad http://www.underbit.com/products/mad/
cd /tmp
wget ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz
tar zxf libmad-0.15.1b.tar.gz
cd libmad-0.15.1b
./configure
make
paco -lp libmad-0.15.1b "make install"
Libao is an opensource cross-platform audio library that provides a simple API to allow programs to output audio. Currently it currently supports: Null output (for testing without a sound device), WAV files, AU files; numerous sound architectures such as OSS (Open Sound System), ALSA (Advanced Linux Sound Architecture), polypaudio (next generation GNOME sound server), esd (EsounD or Enlightened Sound Daemon) and NAS (Network Audio Server)
#libao http://www.xiph.org/ao/
cd /tmp
wget http://downloads.xiph.org/releases/ao/libao-0.8.6.tar.gz
tar zxf libao-0.8.6.tar.gz
cd libao-0.8.6
./configure
make
paco -lp libao-0.8.6 "make install"
ldconfig
#libid3tag http://www.underbit.com/products/mad/
cd /tmp
wget ftp://ftp.mars.org/pub/mpeg/libid3tag-0.15.1b.tar.gz
tar -zxf libid3tag-0.15.1b.tar.gz
cd libid3tag-0.15.1b/
./configure
make
paco -lp libid3tag-0.15.1b "make install"
ldconfig
#mpg321 http://mpg321.sourceforge.net/
cd /tmp
wget http://superb-east.dl.sourceforge.net/sourceforge/mpg321/mpg321-0.2.10.tar.gz
tar zxf mpg321-0.2.10.tar.gz
cd mpg321-0.2.10
./configure
make
paco -lp mpg321-0.2.10 "make install"
#libsndfile http://www.mega-nerd.com/libsndfile/
cd /tmp
wget http://www.mega-nerd.com/libsndfile/libsndfile-1.0.16.tar.gz
tar zxf libsndfile-1.0.16.tar.gz
cd libsndfile-1.0.16
./configure
make
paco -lp libsndfile-1.0.16 "make install"
ldconfig
#LAME http://lame.sourceforge.net/
cd /tmp
wget http://internap.dl.sourceforge.net/sourceforge/lame/lame-3.97b2.tar.gz
tar zxf lame-3.97b2.tar.gz
cd lame-3.97
./configure
make
paco -lp lame-3.97 "make install"
ldconfig
#id3lib http://id3lib.sourceforge.net/
cd /tmp
wget http://easynews.dl.sourceforge.net/sourceforge/id3lib/id3lib-3.8.3.tar.gz
tar zxf id3lib-3.8.3.tar.gz
cd id3lib-3.8.3
./configure
make
paco -lp id3lib-3.8.3 "make install"
ldconfig
FLAC (Free Lossless Audio Codec) FLAC is a compression audio standard similar to MP3, but differs from MP3 in that it is compressed without any loss in quality. FLAC works like any other lossless compression method (zip, gz, sit,etc) but since it is designed specifically for audio so the compression ratio is superior to other general purpose lossless compression methods. FLAC is the only free lossless audio compression codec that has hardware support.
The encoding FLAC utilizes is very robust. It has 16-bit CRC's per frame to detect transmission errors while streaming and has an additional MD5 signature of the original audio data stored in the file header as an additional integrity check. This error resistant encoding scheme limits the damage to the frame that the error occurred in which allows for a data stream not to be completely corrupted even by a large block of corruption within the data stream. The resilience is also enhanced by the fact that each frame is not dependant on the preceding or succeeding frames since it contains all it needs for decompression within the frame. This is nice because that allows decoders to pick up when the stream is no longer being corrupted and to not quit processing the remainder of the stream (this would be important if you wished to get as much of the valid stream data as possible even when there was corruption dispersed throughout it.)
The FLAC files are seekable which allows for index positioning which is great for end-user playback as well as for audio editing applications. The format allows for metadata types to be embedded within the FLAC file and currently contains metadata types for tags, cue sheets (e.g. storing a CD table of contents, all track and index points), and seek tables. Additionally, new metadata blocks can be defined and implemented in future versions of FLAC without the worry of breaking older streams or decoders.
FLAC is an open source, "freely" available (modified BSD license) codec library that is supported on many operating systems: *nix (Linux, *BSD, OS X, Solaris, and IRIX), BeOS, MS Windows OS/2, and Amiga.
#flac http://flac.sourceforge.net/
cd /tmp
wget http://superb-east.dl.sourceforge.net/sourceforge/flac/flac-1.1.2.tar.gz
tar zxf flac-1.1.2.tar.gz
cd flac-1.1.2
./configure
make
paco -lp flac-1.1.2 "make install"
ldconfig
#libogg http://www.vorbis.com/
cd /tmp
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
tar zxf libogg-1.1.3.tar.gz
cd libogg-1.1.3
./configure
make
paco -lp libogg-1.1.3 "make install"
ldconfig
#libvorbis http://www.vorbis.com/
cd /tmp
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
tar zxf libvorbis-1.1.2.tar.gz
cd libvorbis-1.1.2
./configure
make
paco -lp libvorbis-1.1.2 "make install"
ldconfig
Speex is a "gratis" and patent free Open Source Software audio compression format designed specifically for speech (speech coder) whose licensing is the Xiph.org variant of the BSD license.
Speex is based on what is called Code Excited Linear Prediction (CELP) and can compress voice at bit rates ranging from 2 to 44 kbps. Speex's features include: Intensity stereo encoding; Variable bit rate operation (VBR); Voice Activity Detection (VAD); Discontinuous Transmission (DTX); 8 kHz, 16 kHz, and 32 kHz compression in the same bit stream; and Packet loss concealment.
#speex http://www.speex.org/
cd /tmp
wget http://downloads.xiph.org/releases/speex/speex-1.0.5.tar.gz
tar zxf speex-1.0.5.tar.gz
cd speex-1.0.5
./configure
make
paco -lp speex-1.0.5 "make install"
ldconfig
#vorbis-tools http://www.vorbis.com/
cd /tmp
wget http://downloads.xiph.org/releases/vorbis/vorbis-tools-1.1.1.tar.gz
tar zxf vorbis-tools-1.1.1.tar.gz
cd vorbis-tools-1.1.1
./configure
make
paco -lp vorbis-tools-1.1.1 "make install"
ldconfig
#libtheora http://www.theora.org/
cd /tmp
wget http://downloads.xiph.org/releases/theora/libtheora-1.0alpha5.tar.gz
tar zxf libtheora-1.0alpha5.tar.gz
cd libtheora-1.0alpha5
./configure
make
paco -lp libtheora-1.0alpha5 "make install"
ldconfig
#portaudio http://www.portaudio.com/
wget http://www.portaudio.com/archives/portaudio_v18_1.zip
unzip portaudio_v18_1.zip
cd portaudio_v18_1
make -f Makefile.linux
paco -lp portaudio_v18_1 "make -f Makefile.linux libinstall; cp pa_common/portaudio.h /usr/local/include"
ldconfig
#jackd http://jackit.sourceforge.net/
wget http://superb-west.dl.sourceforge.net/sourceforge/jackit/jack-audio-connection-kit-0.100.0.tar.gz
tar zxf jack-audio-connection-kit-0.100.0.tar.gz
cd jack-audio-connection-kit-0.100.0
./configure
make
paco -lp jack-audio-connection-kit-0.100.0 "make install"
ldconfig
#sox http://sox.sourceforge.net/
wget http://superb-east.dl.sourceforge.net/sourceforge/sox/sox-12.17.7.tar.gz
tar zxf sox-12.17.7.tar.gz
cd sox-12.17.7
./configure
make
paco -lp sox-12.17.7 "make install"
#ecasound http://eca.cx/ecasound/
cd /tmp
wget http://ecasound.seul.org/download/ecasound-2.4.3.tar.gz
tar zxf ecasound-2.4.3.tar.gz
cd ecasound-2.4.3
./configure
make
paco -lp ecasound-2.4.3 "make install"
ldconfig
#mplayer http://www.mplayerhq.hu/design7/news.html
mkdir /tmp/mplayer
cd /tmp/mplayer
wget http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0pre7try2.tar.bz2
wget ftp://ftp1.mplayerhq.hu/MPlayer/releases/codecs/essential-20050412.tar.bz2
tar jxf MPlayer-1.0pre7try2.tar.bz2
cd MPlayer-1.0pre7try2
./configure
make
paco -lp MPlayer-1.0pre7try2 "make install"
mkdir /usr/local/lib/codecs
cd /usr/local/lib/codecs/
tar jxf /tmp/mplayer/essential-20050412.tar.bz2