Ogg Vorbis is a free (as in speech) alternative to Mp3 which is subject to various royalty fees. Ogg Vorbis supports most of the features Mp3 does and is a very flexible audio format, especially for streaming.

This howto will try to introduce you to the world of Ogg Vorbis, by explaining how to install it and how to make use of it to store and play your audio data.

What is Ogg Vorbis?

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.

Why use Ogg Vorbis?

Unlike Mp3, Ogg Vorbis is completely free of any patent rights and thus you don't need to pay royalty fees to use it, be it for in or output. In terms of quality, Ogg Vorbis is comparable to Mp3 and does also allow streaming. In most cases it also produces slightly smaller files than Mp3.

Installing Ogg Vorbis.

Most recent distributions include the ogg and vorbis libs, so you only have to check for the right packages on your CDs. If you don't have the packages or if you want to make sure to use the most recent versions, follow the instructions below.

First, we'll need to get the right sources for:
libao - An audio output library used by Ogg
libogg - The base lib for any Ogg media
libvorbis - The Vorbis audio codec for Ogg
libcurl - Needed by the vorbis tools
vorbistools - Various command line tools for Ogg Vorbis, including a basic player and encoder.

You can find the libao, libogg, libvorbis and vorbistools source packages (tar.gz) at

The curl package can be downloaded at

Once you have downloaded the needed packages, untar them by typing (for each package respectively) tar -xvzf packagename.tar.gz

Then, for each package, do the following (you should do it in the same order than the packages are listed above):

"cd" to the package directory
type "./configure"
then "make"
and as root "make install"
finally, before proceeding to the next package, do an "ldconfig" as root.

Once the vorbistools are installed, everything should be installed correctly.

Creating .ogg vorbis files

The vorbistools package contains some basic tools to handle .ogg vorbis files, including an Ogg Vorbis encoder, oggenc.

oggenc reads audio data in either raw, WAV, or AIFF format and encodes it into an Ogg Vorbis stream.

The simplest syntax is: oggenc music.wav
This will produce an Ogg Vorbis music file as music.ogg with default settings.

You can modify the quality by specifying either a bitrate with the -b switch or a quality setting with the -q switch. examples:

Specifying a high-quality encoding averaging 256 kbps.
oggenc infile.wav -b 256

Specifying quality rather than bitrate (to a very high quality mode)
oggenc infile.wav -q 9 (quality ranging from 0-10)

It is also possible to encode multiple files using wildcards:
oggenc *.aif

Like with Mp3 files, you can also add Tag information to an .ogg file using the -a -G -d -N -t -l switches. example:

oggenc somefile.wav -t "The track title" -a "artist who performed this" -l "name of album"

To get more information about the various switches you can use with the encoder, read it's manual page by typing "man oggenc".

If you are looking for command line or GUI tools to ease the task of encoding .ogg vorbis files or converting your Mp3 collection, here are a few:

CD rippers:
- A KDE frontend for CD burning and ripping.
- A light KDE frontend to CDParanoia and OggEnc.
- a Gnome CD player and ripper.
- A console cd-ripper written in python.

Mp3 converters:
- Converts MP3 files to Ogg Vorbis format.
- An MP3 to Ogg Vorbis converter.

Playing .ogg vorbis files

The vorbistools package also includes a commandline Ogg Vorbis player, ogg123. ogg123 reads Ogg Vorbis audio files and decodes them to the devices specified on the command line. By default, ogg123 writes to the standard sound device, but output can be sent to any number of devices. Files can be read from the file system, or URLs can be streamed via HTTP.

The easiest syntax is:
ogg123 music.ogg This will play the file through the default sound driver.

You can also specify multiple files as a sort of playlist. Giving the -z switch will play the files in random order. You can interrupt playing at any time by pressing Ctrl-C. If multiple files are specified it will skip to the next file. Pressing Ctrl-C twice in a short delay will cancel the whole playlist.

You can also specify an alternative output driver using the -d switch. (eg. -d oss -d alsa -d esd, etc.)

ogg123 can also be used to decode .ogg vorbis files into another format using the -d and -f switches. If you specify raw, wav or au for the -d switch, the sound output will be written to a file given by the -f switch. eg.: ogg123 -d wav -f test.wav test.ogg

More information can be found by typing "man ogg123".

Several nicer tools are also available for playing .ogg files:

Xmms -
BLAINE -
jOggPlayer -
Ogg Vorbis Player -
PlayOgg -
squelch -

If you need the ultimate tool to rip, convert, organize, play and even burn your .ogg audio files, try , which is largely inspired by Apple's iTunes program.