Next: Composition Environments
The PCM (pulse-code modulation) established for CD-DA discs is not
very compact and doesn't suit for delivering music via the net. That
is why developers now are working on a number of complex compression
algorithms. All of them differ very much in the sound quality, that is
why a user has always to make a choice of an algorithm for its
favorite music to be recorded.
- Ogg Vorbis:
is a fully Open, non-proprietary,
patent-and-royalty-free, general-purpose compressed audio format for
high quality (44.1-48.0kHz, 16+ bit, polyphonic) audio and music at
fixed and variable bitrates from 16 to 128 kbps/channel. This places
Vorbis in the same class as audio representations including MPEG-1
audio layer 3, MPEG-4 audio (AAC and TwinVQ), and PAC.
Ogg Vorbis provides a high-quality format for you to listen to
your music. Its file size is also smaller than MP3 and
getting smaller as development continues. Vorbis already
enjoys widespread player support and should be compatible
with several major hardware players soon. With Vorbis, you
can listen to your music with higher quality in less
space. Also, using Vorbis means your player and encoder
choices aren't bound by licensing terms.
(man page ) is part of
the ``vorbis-tools'' package. This program is a complete encoder
that creates Ogg Vorbis compressed soundfiles. OggEnc input files
must currently be 16 or 8 bit PCM WAV, AIFF, or AIFF/C
files. Files may be mono or stereo (or more channels) and sampling
rates between 8kHz and 56kHz. Call oggenc with the ``-h'' flag or
see the oggenc man page for more details.
This will create a ``sample.ogg'' output soundfile:
You can do a format conversion and pipe that to oggenc using unix
pipes, for example the following command will convert a soundfile
from .snd format to .wav and feed it to the encoder:
sox -t .au sample.snd -t .wav - | oggenc -o sample.ogg -
(man page ) is also part of
the ``vorbis-tools'' package. In essence it is simple command line
Ogg Vorbis decoder and player. You can play your ``ogg files'' with
- Play your Ogg files with xmms:
The X Multimedia System (xmms) can recognize and play Ogg Vorbis
encoded files. Just open xmms as follows:
does not need an introduction. It is a stereo compression
standard that has become widespread in hardware and firmware based
players, and is widely used for web distribution of music
content. Regretfully even though it is a standard, it is not for
free. Patent licenses under the combined patent portfolio of
Fraunhofer IIS-A and Thomson multimedia are granted by Thomson
multimedia exclusively and cover format encoders and decoders and
commercial (revenue-generating) distribution of music. Read all the
details in http://www.mp3licensing.com.
According to the patent owners it is not possible to independently
create an mp3 encoder without infringing on the patents. Recently
they have started to crack down on open source projects that have
created free alternatives to the commercial mp3 encoders. Read more
about this in the lame
(http://www.sulaco.org/mp3) and bladeenc
(http://bladeenc.mp3.no/) web sites
A couple of widely available encoders are available in PlanetCCRMA,
but are only intended to be used as tools for learning about mp3. If
you encode your own mp3s you should own a properly licensed encoder.
means, Lame Ain't an MP3 Encoder and is an educational tool to
be used for learning about MP3 encoding. The goal of the LAME
project is to use the open source model to improve the psycho
acoustics, noise shaping and speed of MP3. Run lame with the
``-help'' option or see the lame man page for more details.
Audio files created with Lame can be played back by popular MP3
players such as Xmms mpg123 or madplay.
For example a command for a fixed bit rate jstereo 128kbs
encoding, highest quality :
lame -h sample.wav sample.mp3
A good choice for Music with a broad dynamic range might be :
lame -abr sample.wav sample.mp3
- Compressing audio with Lame presets
The Lame -preset switches are designed to provide the highest
possible quality. These are continually updated to coincide with the
latest developments that occur and as a result should provide you with
nearly the best quality currently possible from LAME.
To activate these presets:
This preset should generally be transparent to most people on
most music and is already quite high in quality.
If you have extremely good hearing and similar equipment, this preset
will generally provide slightly higher quality than the standard
This preset will usually be to much for the common user and most
situations, but if you must have the absolute highest quality with no
regard to filesize, this is the way to go.
Using this preset will usually give you good quality at a speci-
fied bitrate. Depending on the bitrate entered, this preset will
determine the optimal settings for that particular situa-
tion. While this approach works, it is not nearly as flexible as
VBR, and usually will not attain the same level of quality as VBR at
For example to use the extreme preset you will use this command:
lame -preset extreme infile.wav outfile.mp3
- Converting MP3s to raw audio to create audio CDs
mpg123 -s file.mp3 | sox -c2 -s -w -t raw \
44100 - -t wav - > newsoundfile.wav
mpg123 converts file.mp3 to the .wav file newsoundfile.wav and
makes it ready to be part of audio CDs.
is a freeware MP3 encoder. It is based on the same ISO compression
routines as mpegEnc, so you can expect roughly the same, or better,
quality . The main difference is the appearance and speed. BladeEnc
doesn't have a nice, user-friendly interface like mpegEnc, but it
is more than three times faster, and it works with several popular
front-end graphical user interfaces. Run bladeenc without arguments
to get a usage description. Unfortunately BladeEnc is not longer in
development but its features appear to be part of the Ogg team
Next: Composition Environments
© Copyright 2001-2006 CCRMA, Stanford University. All rights reserved.
Created and Mantained by Juan Reyes