Wednesday, August 7th, 2024

Ancient audio formats
=====================

When microcomputers in the 1980s  got enough computing power and could
start  making  sounds beyond  beep-blop-beep  and variously  modulated
sawtooth signals, several formats for storing sampled audio bitstreams
emerged. Some time ago,  I came across a few of them, and this text is
kind of a summary of what I learned. Maybe someone else will also find
it useful.

Interchange File Format / 8-Bit Sampled Voice (IFF / 8SVX)
----------------------------------------------------------
Created in 1985 by Electronic Arts in collaboration with Commodore for
Amiga computers.  It contains 8-bit  audio data stored  within chunks,
and since 8SVX is just one of the chunk subtypes, it is not limited to
pure audio files, but can also include animation and graphics[1][2].

The sound  is typically encoded  as an uncompressed  linear pulse-code
modulation bitstream,  but Fibonacci-delta lossy data compression  can
be used,  resulting  in a 50% size  reduction.  The VHDR  header block
contains  information  about  compression,  as well as sample rate and
volume.

Audio Interchange File Format (AIFF)
------------------------------------
An audio format developed by Apple in 1988 for Mac. It is derived from
the IFF  and makes it possible  to store 16-bit sound  with additional
metadata such  as instrument information or raw MIDI data.  The AIFF-C
subtype was introduced in 1991, allowing for the storage of compressed
audio as well as the ability to specify the endianness of data[3].

The Mac OS CD-ROM driver  transparently maps audio CDs  to AIFF files,
so when  a CD is inserted into the drive,  the user sees  audio tracks
as AIFF files that can be freely copied to the hard drive.

Resource Interchange File Format / Waveform Audio (RIFF / WAV)
--------------------------------------------------------------
This format is also derived from the Amiga's IFF, but it was developed
in 1991  by two big  industry names - Microsoft and IBM - in a need of
a standard  sound  format for  the then-expanding  audio  capabilities
of PC-compatible  machines.  WAV,  like IFF  and 8SVX,  is just one of
the RIFF format's subtypes, so it is theoretically possible to combine
other types  of media into a single file,  but this option  was not as
widely used as it was  on Amiga.  WAV supports both  8-bit and  16-bit
sound and is typically encoded using linear pulse-code modulation, but
compression can also be used.  All data is in  a little endian format,
which is native to x86 processors[4][5].

Au/Snd file format
------------------
The only  widely used audio format  of the 1980s  and early 1990s that
was not based on the IFF was created by Sun Microsystems.  It was also
common on NeXT computers, so it's often referred to as Sun/NeXT Audio.
The specification includes 27 possible sound encoding formats, such as
an uncompressed linear PCM stream with a sample width of 8 to 32 bits,
32-bit  and 64-bit floating point streams,  various compression types,
and DSP commands. The sample rate ranges between 8 and 48 kHz[6].

An  interesting  fact is  that  the SPARCstation1 had  a sound  device
/dev/audio, which played sound directly in this format; you simply had
to send  the contents of an Au file to the it.  No other  software was
required. Additionally,  the Au format was the first audio format used
on  the World-Wide-Web,  which was first developed  on NeXT computers,
and it remained  the most popular one  until the MP3 took over  in the
late 1990s.

..

Several years ago,  I created  a script that generates  a podcast from
a local groove/funk music radio show.  At first, it was a quite simple
task:  parsing the webpage  of the radio station,  locating  all links
to MP3 files  and generating  the RSS/XML file.  But then they stopped
distributing the show as MP3 files and instead broke each episode into
thousands of M4A chunks, with a descriptor file (chunklist) specifying
the sequence in which these chunks should be played.

I had to rewrite the script from scratch: on my server, I download the
chunklists  of all episodes  available  on the web,  then download all
the chunks of  one episode  according  to the chunklist,  merge  them,
convert to MP3 format,  save the file locally and generate the RSS/XML
file.  If someone  looked into  the copyright aspect  the whole thing,
they probably wouldn't be very happy, but I simply didn't want to miss
out on my favorite show.

When I finished all this  and the podcast started working on my iPhone
again,  I decided  to create  also  a version for  vintage  computers,
accessible via both WWW and Gopher. Therefore, after converting to MP3
the script also  converts each episode  to 8SVX/IFF and Au formats and
in addition to RSS/XML,  it generates a simple HTML 3.2 webpage[7] and
a Gophermap[8]. Although the show is in Czech, and the spoken word may
not make much sense to English listeners, you can still enjoy at least
the music. And you can do it on your Amiga, SPARCstation, or NeXT!

[1] https://en.wikipedia.org/wiki/Interchange_File_Format
[2] https://en.wikipedia.org/wiki/8SVX
[3] https://en.wikipedia.org/wiki/Audio_Interchange_File_Format
[4] https://en.wikipedia.org/wiki/Resource_Interchange_File_Format
[5] https://en.wikipedia.org/wiki/WAV
[6] https://en.wikipedia.org/wiki/Au_file_format
[7] http://i-logout.cz/other/grundfunk/funkybits/
[8] gopher://i-logout.cz:70/1/cz/funkybits/