Features
mpg123 the player
We all know that mpg123 is the fast console mpeg audio decoder/player, don't we? But here are some things that go beyond simple decoding:
- support for many platforms (many Unices, MacOSX, Windows) and audio subsystems
- simple but powerful control mode for frontends (commands via STDIN)
- realtime control of efficient equalizer (because built into decoder)
- built-in terminal control keys
- support for gapless playback of mp3 files (skipping encoder/decoder padding/junk)
- many audio data settings: resampling, choose channel, mono, ...
- really efficient with a growing number of assembler optimizations (pentium, MMX, AltiVec, ...)
- support for Relative Volume Adjustment / ReplayGain
- … see the feature list of libmpg123
- several audio output options using libout123
- audio format/rate/channel conversions using libsyn123
out123 the sound output utility
This little program routes sound given via standard input or generated by libsyn123 to outputs handled by libout123, possibly with some conversion and mixing by libsyn123.
libmpg123
The decoder part of mpg123 is usable as a library in your application. Features include:
- decoding of MPEG 1.0/2.0/2.5 layer I/II/III audio streams to interleaved PCM, also free-format bitrates over 320 kbit/s
- sample-accurate seeking and gapless playback (via LAME Info frame)
- choice of sample encoding (from 8 bit µlaw to 32 bit float), mono mix
- build-time choice for integer or floating-point synth
- assembly/SIMD optimisations for common sample encodings and decoding modes
- choices between accuracy and efficiency (rounding modes, dithering)
- efficient 2:1 or 4:1 downsampling, sparing decoder work to evaluate the dropped samples
- n:m pseudo-resampler (repeat/drop samples without interpolation) as last resort to enable playback with enforced sample rate (by default libsyn123's low-latency resampler)
- tune frequency scale factors for zero-cost equaliser (with 32 linearly-spaced bands given my MPEG; not pretty, but hey, it's free!)
- tune volume via scale factors, again without extra CPU cost
- parse and apply relative volume adjustment read from metadata (RVA2, ReplayGain)
- parse ID3v1, ID3v2 and ICY stream metadata (with configured interval), silenty skip other stuff
- graceful handling of stream errors (silence instead of whiny twittering)
- disabling of features to enable smaller builds for embedded systems
(a generic x86-64 float-output binary of from mpg123-1.23.0
using gcc-4.9.2 with
-Os
is 118 KiB stripped, still with all the essential sample-accurate codec functionality)
libout123
The mpg123 output library (libout123) supports a wide range of audio interfaces, including:
- ALSA (Advanced Linux Sound Architecture)
- CoreAudio (Mac OS X)
- EsounD (The Enlightened Sound Daemon)
- JACK (Jack Audio Connection Kit)
- NAS (Network Audio System)
- OSS (Open Sound System)
- PortAudio (Portable cross-platform Audio API)
- PulseAudio (sound server for POSIX and Win32)
- SDL (Simple DirectMedia Layer)
- Sun Audio (/dev/audio)
- Win32 (Windows WaveOut)
It also wraps over an optional buffer process to ensure continuous playback without having to deal with concurrency in the application itself.
libsyn123
The mpg123 synthesis library for low-latency conversion, resampling, mixing and signal generation, the latter user-accessible via the out123 program.