Ecasound Audio Format Libraries
Ecasound is a powerful command-line multitrack audio processing tool for Unix-like systems that relies heavily on external libraries to read, process, and write various audio file types. While it provides native support for raw PCM data and basic headerless streams, compiling Ecasound against dedicated third-party libraries significantly expands its compatibility with standard, compressed, and high-resolution container formats. This article details the primary external libraries Ecasound can link against to enhance its audio format support.
libsndfile
libsndfile is the most critical format library for
Ecasound. Developed by Erik de Castro Lopo, this C library provides
comprehensive read and write support for a vast array of uncompressed
and compressed audio formats. When Ecasound is compiled with
libsndfile support (enabled via
--enable-sndfile), it gains access to:
- WAV / RIFF (including 16-bit, 24-bit, 32-bit float, and multi-channel configurations)
- AIFF (Apple Interchange File Format)
- AU / SND (Sun/NeXT audio)
- FLAC (Free Lossless Audio Codec, depending on the
libsndfilecompile options) - OGG / Vorbis (when bundled within
libsndfile) - PAF, IFF/SVX, VOC, and various telephony formats such as G.711 ยต-law and A-law
libaudiofile
Before libsndfile became the de facto standard, Silicon
Graphics' libaudiofile (Audio File Library) served as an
alternative backend. Ecasound can link against libaudiofile
using the --enable-audiofile flag. It provides support for
standard formats including:
- AIFF and AIFF-C
- WAVE
- NeXT/Sun .snd/.au
- IRCAM Soundfiles
- Audio Visual Research (AVR) formats
While functional, libsndfile is generally preferred over
libaudiofile in modern installations due to more active
maintenance and broader format coverage.
libvorbis and libogg
For direct Ogg Vorbis compressed audio processing without wrapping through other libraries, Ecasound can be linked directly against the official Xiph.Org Foundation libraries:
- libogg: Handles container bitstream manipulation.
- libvorbis / libvorbisenc: Handles decoding and encoding of Vorbis streams.
Enabling direct Vorbis integration allows Ecasound to encode
real-time output straight to .ogg files or decode them
directly into signal chains with optimized memory buffering.
libmad
The MPEG Audio Decoder (libmad) is a high-quality
integer-based MPEG audio decoder library. Linking Ecasound against
libmad (--enable-libmad) allows native
decoding of MPEG audio streams, notably:
- MP3 (MPEG-1 Audio Layer III)
- MPEG-2 Audio Layer III
Because libmad is exclusively a decoder, it only
provides MP3 playback and reading support inside Ecasound. For MP3
output and encoding, Ecasound relies on spawning external command-line
encoders like LAME rather than direct linking.
libsamplerate (Secret Rabbit Code)
Although technically an audio processing library rather than a
container parser, libsamplerate is closely tied to format
support during import and export. Linking against
libsamplerate allows Ecasound to convert non-matching
sampling rates on the fly when reading input files or preparing streams
for output formats that require specific standard rates (such as 44.1
kHz for CD audio or 48 kHz for broadcast media).