%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{Audio Interchange File Format}
AIFF is the Audio Interchange File Format.
It is popular on Apple computers and is a precursor to the more
widespread WAVE format.
All values in AIFF are stored as big-endian.

\section{the AIFF File Stream}
\begin{figure}[h]
\includegraphics{figures/aiff/stream.pdf}
\end{figure}

\section{the COMM Chunk}
\begin{figure}[h]
\includegraphics{figures/aiff/comm.pdf}
\end{figure}
\par
\noindent
The \VAR{Sample Rate} field is an 80-bit IEEE Standard 754 floating point value
instead of the big-endian integers common to all the other fields.
\begin{align*}
\text{value} &= (-) \frac{\text{mantissa}}{2 ^ {63}} \times 2 ^ {\text{exponent} - 16383}
\intertext{For example, given a sign bit of 0, an exponent value of 0x400E
and a mantissa value of 0xAC44000000000000:}
\text{value} &= \frac{12413046472939929600}{2 ^ {63}} \times 2 ^ {16398 - 16383} \\
&= 1.3458251953125 \times 2 ^ {15} \\
&= 44100.0
\end{align*}

\section{the SSND Chunk}
\begin{figure}[h]
\includegraphics{figures/aiff/ssnd.pdf}
\end{figure}
