%Copyright (C) 2007-2015  Brian Langenberger
%This work is licensed under the
%Creative Commons Attribution-Share Alike 3.0 United States License.
%To view a copy of this license, visit
%http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to
%Creative Commons,
%171 Second Street, Suite 300,
%San Francisco, California, 94105, USA.
\chapter{Introduction}
Python Audio Tools, as a collection of software,
is built in a stack-like fashion.
At the top of the stack sits the user-facing utilities
such as \texttt{tracktag} or \texttt{track2track}.
These take command-line arguments, display progress to the user,
have manual pages and so forth.
But these utilities don't do very much work by themselves;
much of \texttt{track2track}'s code is there to facilitate
calling a simple \texttt{convert()} Python method.

The \texttt{audiotools} Python module is the next layer of the stack.
It's documented separately and offers a superset of the functionality
offered by the user-facing utilities.
Python programmers can assemble its wide array of classes
and functions into specialized utilities for particular tasks.
One can even use Python's interactive mode to work with
the tools directly (something I find quite helpful when debugging).

But Python, as a language, simply isn't designed to do
high-speed numerical processing on its own.
So the third layer of the stack is a set of Python extension
modules written in C to perform audio file decoding, encoding
and stream processing in chunks at an acceptable rate.
Even Python programmers are unlikely to fiddle with these
directly; it's easier to let the higher-level Python routines
smooth out the rough edges for you.

Yet there's still one more layer to the stack,
which is this documentation on exactly how the
audio formats and their metadata operate.
Everything above sits atop these notes, pseudocode and examples.
Even if Python and C should suddenly vanish in a puff of logic,
I could rebuild my utilities through this documentation
in any language available.

At the same time, it's also useful for anyone curious
on the inner workings of the audio formats and metadata
supported by Python Audio Tools.
Wherever possible, pseudocode and examples have been
placed on opposite pages so one can work through the code
by hand.
Don't be afraid to open up your files with a hex editor
to see how your music is stored and tagged.
