SOFTWARE
I
tried to make the code as simple and as minimal
as possible so it would be easy to understand.
The code currently supports WAV and MP3 formats.
You can find information about both formats
on the Internet if you’re interested.
The
WAV file format supports a variety of bit resolutions,
sample rates, and channels of audio. A WAV file
is a collection of a number of different types
of chunks. There is a required format (“fmt”)
chunk, which contains important parameters describing
the waveform, such as its sample rate. The data
chunk, which contains the actual waveform data,
is also required. The other chunks are optional.
The
minimal WAV file consists of a single WAV containing
the two required chunks: a format chunk and
a data chunk. There are a number of variations
on the WAV format, but if you convert from CD
to WAV format, then most of the software will
create the simplest WAV file.
MP3
is the other popular audio file format for compressed
data. MP3 files are composed of a series of
frames. Each frame of data is preceded by a
header, which has extra information about the
data to come. Extra information, which is called
ID3 data, may be included at the beginning or
end of an MP3 file. Figure 3 (p. 45) shows the
MP3 format with a hex representation of bytes
and an explanation. You can investigate it by
opening the file in any hex editor. I use WinHex
because it has a disk utility as well. All of
the source code is posted on the Circuit Cellar
FTP site.