The field at offset 12 of the header says
how the audio is stored. NeXT’s soundstruct.h says user-defined codes
should be greater than 255 and negative codes (0x80000000 and up when read as unsigned) are
reserved; codes 0 to 33 are the ones named below and 34 to 255 are assigned by no header.
Codes
Linear formats are signed, centred on zero, and most significant byte first.
| Code | Name | Size | Meaning |
|---|---|---|---|
| 0 | unspecified | no encoding given | |
| 1 | MULAW_8 | 1 | G.711 µ-law |
| 2 | LINEAR_8 | 1 | 8-bit signed linear PCM |
| 3 | LINEAR_16 | 2 | 16-bit signed linear PCM |
| 4 | LINEAR_24 | 3 | 24-bit signed linear PCM |
| 5 | LINEAR_32 | 4 | 32-bit signed linear PCM |
| 6 | FLOAT | 4 | 32-bit IEEE floating point |
| 7 | DOUBLE | 8 | 64-bit IEEE floating point |
| 8 | INDIRECT | fragmented sample data; a sound in memory only (NeXT’s SNDSoundStruct documentation: each fragment gets its own header and the original header’s dataLocation is set to the address of a NULL-terminated block of their addresses; NeXT’s filesound.h: a fragmented sound is written out unfragmented), so it does not occur in files | |
| 9 | NESTED | multiple sound structures (Kaitai’s AU specification); defined in soundstruct.h and SndFormats.h and used by no SoundKit, MusicKit or SndKit code, so it has no layout (details) | |
| 10 | DSP_CORE | a loadable DSP core program, made by reading a DSP load file (.lod); layout | |
| 11 | DSP_DATA_8 | 1 | 8-bit DSP data: the MusicKit documentation calls it “8-bit fixed-point samples” and the SoundKit byte-swap routines treat it as one byte a sample, but no source states its scale or sign. The explorer plays it as 8-bit signed linear, the way codes 12 to 14 are read as 16-, 24- and 32-bit signed linear (details) |
| 12 | DSP_DATA_16 | 2 | 16-bit DSP data, big-endian: read exactly as code 3 (details) |
| 13 | DSP_DATA_24 | 3 | 24-bit DSP data, big-endian: read exactly as code 4 (details) |
| 14 | DSP_DATA_32 | 4 | 32-bit DSP data, big-endian: read exactly as code 5 (details) |
| 15 | unassigned | ||
| 16 | DISPLAY | 2 | non-audio display data used by the Sound Kit’s SoundView class; it cannot be played (stored as 16-bit big-endian words) |
| 17 | MULAW_SQUELCH | 1 | 8-bit µ-law with run-length encoding of silence (layout) |
| 18 | EMPHASIZED | 2 | 16-bit linear with emphasis: stored exactly like code 3, and played with the sound hardware’s low-pass filter turned on (details) |
| 19 | COMPRESSED | 16-bit linear, compressed by the SoundKit: Parallel Packing or ATC (layout); MusicKit’s SndFormats.h calls it “Julius O. Smith III’s SoundKit compressed format” | |
| 20 | COMPRESSED_EMPHASIZED | 16-bit linear with emphasis, compressed by the SoundKit (layout); the same comment in SndFormats.h | |
| 21 | DSP_COMMANDS | a Music Kit performance recorded as the messages sent to the DSP (SndFormats.h: “MC56001 DSP instruction opcodes”); only the Music Kit’s DSP library makes them; not audio (layout) | |
| 22 | DSP_COMMANDS_SAMPLES | code 21 plus samples streamed to the DSP (SndFormats.h: “audio data in a format suitable for MC56001 DSP use?”); only the sample count is documented (what is known) | |
| 23 | ADPCM_G721 | 4 bits | CCITT G.721 ADPCM, 32 kbit/s |
| 24 | ADPCM_G722 | CCITT G.722 sub-band ADPCM | |
| 25 | ADPCM_G723_3 | 3 bits | CCITT G.723 ADPCM, 24 kbit/s |
| 26 | ADPCM_G723_5 | 5 bits | CCITT G.723 ADPCM, 40 kbit/s |
| 27 | ALAW_8 | 1 | G.711 A-law |
| 28 | AES | AES/EBU digital audio: in the SoundKit it is the data-encoding value of a sound stream whose source or sink is the AES port (NXSoundParameters.m), not a file layout; MusicKit’s SndFormats.h comments it “a format specified by the Audio Engineering Society?”; no code reads or writes a sound file with it, so no layout is defined | |
| 29 | DELTA_MULAW_8 | 1 | named in NeXT’s soundstruct.h and NeXT.cpp with no description; “delta µ-law” is a reading of the name; NeXT’s SoundKit source gives it one byte a sample and has no decoder for it; no layout published |
| 30 | MP3 | MPEG-1 Layer 3 (MusicKit SndFormats.h, a later addition): the in-memory format of the SndKit’s SndMP3 object, which loads a plain .mp3 file; no SndKit code reads or writes a .snd with it (details) | |
| 31 | AAC | MPEG-4 Advanced Audio Coding (MusicKit SndFormats.h); named only, nothing in the SndKit uses it | |
| 32 | AC3 | Dolby AC-3 (MusicKit SndFormats.h); named only, nothing in the SndKit uses it | |
| 33 | VORBIS | Ogg Vorbis (MusicKit SndFormats.h); named only, nothing in the SndKit uses it |
The names without the AUDIO_AU_ENCODING_ or SND_FORMAT_
prefix come from the NeXT and Sun headers as libsndfile, the Solaris manual and McGill’s
notes give them, and where these differ (8 is called fragmented, 19 is called
NEXT by libsndfile) the meaning above is the common one.
Codes 17 (run-length coded µ-law), 18 (16-bit linear, emphasised), 12 to 14 (DSP data, read as codes 3 to 5) and the compressed codes 19 and 20 (Parallel Packing and ATC) are read from NeXT’s own SoundKit source, described below, after it and in the compression section, and the explorer plays all of them. Codes 10, 16, 21 and 22 are described as far as that source goes; the SoundKit and MusicKit source gives 9, 28 and 29 no layout (and code 11 no stated scale: the explorer plays it as 8-bit signed linear) and 30 to 33 none for a file. The explorer names the codes it does not play and shows their header and bytes.
The 3-, 4- and 5-bit ADPCM codes (23, 25, 26) are packed first code in the low bits of each byte, as the
Sun reference code does (libsndfile’s g72x.c reads in_buffer |= byte << in_bits
and takes the low bits first; SoX’s au.c, adapted from Sun’s decode.c, unpacks the same way).
The explorer decodes them with a port of that reference code and its output equals a build of the C code
sample for sample; ITU-T G.726 decoders such as FFmpeg’s differ from it in small steps. Code 24 (G.722, 64 kbit/s mode) holds one byte per pair of samples (a 6-bit lower sub-band code and a
2-bit upper sub-band code), and the stream is decoded at the rate in the header.
G.721, G.723 and G.726. ITU-T G.726 (1990) says in the footnote to its title: “This Recommendation completely replaces the text of
Recommendations G.721 and G.723 published in Volume III.4 of the Blue Book. It should be noted that systems designed in accordance with
the present Recommendation will be compatible with systems designed in accordance with the Blue Book version.” Its §1 describes the conversion
of a 64 kbit/s A-law or µ-law channel “to and from a 40, 32, 24 or 16 kbit/s channel”, and §1.1 and §2.3 give the quantizer for those rates as
31, 15, 7 and 4 levels, that is five, four, three and two binary digits a sample. So a decoder that equals G.726 at 32, 24 and 40 kbit/s decodes
the AU codes 23 (G.721, 4 bits), 25 (G.723, 3 bits, 24 kbit/s) and 26 (G.723, 5 bits, 40 kbit/s); the rates follow from the digits a sample at 8,000 samples a second,
and the names are NeXT’s and Sun’s. The text does not itself say which of the old Recommendations covered which rate, and the G.721 and G.723 texts
were not available to read, so what they would add is the 1988 wording of the same algorithms and their own test sequences, nothing that the compatibility sentence
leaves open. The 16 kbit/s (2-bit) rate has no AU code; FFmpeg’s private code 0x37323632 is that rate. The G.723 here is the ADPCM of the Blue Book, not
G.723.1, the speech coder at 6.3 and 5.3 kbit/s (see the WAV format codes, where Lucent’s 0x0059 is “G.723.1, or the older G.723 ADPCM”).
The ITU-T Software Tool Library’s G.726 module (UGST, src/g726) carries the recommendation’s own
test sequences: a file of codes (.i) and the decoder output as A-law or µ-law (.o), for 16, 24, 32 and
40 kbit/s (the AU codes 25, 23 and 26, and FFmpeg’s private 2-bit code), A-law and µ-law, a normal signal (16,384 samples) and an overload signal (2,048), each starting from the reset
state (rn, rv) and from the state after the homing sequence (hn, hv;
ITU-T G.726 Appendix II describes them). All 32 sequences, 294,912 samples, were run through the explorer’s decoder and the
output was converted to A-law or µ-law and given the synchronous coding adjustment of clause 4.2.8 with ports of the module’s
G726_compress and G726_sync: every sample equals the ITU output. (The adjustment moves a sample by one
law code and exists so that tandem codecs stay in step; an AU file holds the linear decoder output, so the explorer does not apply it.
Without it, 0.3% of the samples are one law code away.) Two details matter. Saturation at overload follows these sequences: the decoded
sample is limited to the 16-bit range, not wrapped as libsndfile’s 16-bit store does. The homing sequence is the 3,496 values
of PCM_INIT (the copies pcm_init.m and .a in the Software Tool Library carry 88 damaged
words at the end; the original files of the Appendix II disks have the 3,496), run through the codec from reset; a build of
the ITU module reproduces all 32 sequences exactly this way.
Code 24 was checked the same way against the ITU-T G.722 module’s test sequence (codspw.cod, 48,768 code bytes, and
the reference outputs for 64, 56 and 48 kbit/s): the explorer’s G.722 decoder gives all 97,536 samples of every mode exactly.
FFmpeg also recognises the private value 0x37323632
(7262) for little-endian G.726. It is not an assigned code.
The explorer reads the whole sound, however long: G.721, G.722 and G.723 are decoded in order (each channel’s predictor depends on every code before it), the decoder’s state is saved every few million frames, and the waveform, the peak and RMS levels and Play start from the nearest saved state. A sound of 9 million frames is seen and heard to its last frame.
Two forms of the G.721 and G.723 decoder
Sun’s reference code for G.721 and G.723 (the code its tools and SoX’s g72x.c use) rounds the product of
two floating-point-like numbers with (a * b + 0x30) >> 4. libsndfile started from the same code and later
removed the + 0x30; its source says it “could see no valid reason” for it. The two forms decode the same
code stream to slightly different samples, and the difference builds up because every sample feeds the next prediction.
The explorer implements the Sun form (the + 0x30 kept), and its output is equal sample for sample to a build of
that code. Which tool wrote a file decides which form its samples were made for:
- A file written with the Sun code or SoX’s copy decodes exactly with the Sun form.
sf-g721.au, a file from a different writer, agrees with it. - A file written by libsndfile was made with its own form (no rounding term in the current source). Decoded with the Sun form, the three libsndfile-written sample files differ from what libsndfile’s own decoder gives by 34% to 55% of the signal (relative RMS). They are still recognisably the same sound, but the explorer’s samples, levels and waveform are not libsndfile’s, and a current libsndfile will not reproduce them.
- FFmpeg’s G.726 decoder aims at ITU-T G.726 but is not ITU-exact (it differs from the ITU STL decoder, which the explorer matches; scripts/pcm/g726-ffmpeg-compare.mjs), and it differs from both in small steps (0.02 to 0.65 relative RMS against the Sun form on the same streams); the explorer uses it only for FFmpeg’s private 2-bit code.
Nothing in an AU header says which form a file needs; the encoding code is the same. Compare with another decoder when exact samples matter.
Run-length coded µ-law (code 17)
NeXT’s SoundKit source (squelch.c, with the DSP programs encodemulawsquelch.asm and
decodemulawsquelch.asm by Dana Massie, 1989) defines the data of code 17. It is 8 kHz µ-law with the
silences run-length coded. The data starts with a 16-byte internal header:
| Offset | Size | Meaning |
|---|---|---|
| 0 | 1 | the file flag 0xA5 |
| 1 | 1 | 0 |
| 2 | 2 | the encoder’s threshold, big-endian (default 100) |
| 4 | 4 | the length in bytes of the sound before encoding, big-endian |
| 8 | 8 | reserved; the decoder discards them |
Runs of up to 255 bytes follow, each a flag byte and a length byte. Flag 0x55 is a run of silence: the
decoder writes the µ-law zero 0xFF that many times and no bytes follow. Flag 0xAA is a run of
samples: the next length bytes are µ-law samples, copied as they are. Any other flag means the stream is out of step and
the decoder stops. The decoder writes a sample before it counts the run down, so a length of 0 would give one sample; the
encoder never writes one. The explorer indexes the runs once and reads the sound by ranges.
What NeXT’s SoundKit source says about the other codes
The SoundKit source (NeXT’s sound library, released by Apple with Darwin) has no description of most of these
codes, but its conversion and file routines fix some facts:
- 18, emphasised: the sound is 16-bit big-endian linear, handled by the same mono, stereo and rate
conversion code as code 3. What makes it emphasised is playback: the player turns the sound hardware’s low-pass filter on
(
SNDSetFilter(1)) for codes 18 and 20. The filter is part of the hardware, so the explorer shows the samples as stored and does not apply it. - 12, 13, 14, DSP data: sixteen, twenty-four and thirty-two bits a sample, stored as big-endian two’s
complement integers like codes 3, 4 and 5 and byte-swapped the same way. They are what comes in from the DSP’s serial port when a
sound is recorded through it; the SoundKit’s
performsound.csays the sound “must be changed toSND_FORMAT_LINEAR_16to be played back” and handles both with the same width, and MusicKit’s SndKit reads 12, 13 and 14 with the same code and the same full scale (32768, 8388608 and 2147483648) as codes 3, 4 and 5. The explorer does the same. - 11, DSP data, 8 bits: one byte a sample (
utilsound.c), but no SoundKit or SndKit routine converts, plays or scales it, so the explorer names it and does not play it. - 10, DSP core: a list of big-endian 32-bit integers, each a 24-bit DSP word. It starts with a system
segment of eight integers (type 0, a version, the segment size 5, the sample count as a high and a low 24-bit word, a buffer
size and two unused), then load segments of type, address and word count followed by the words, ending with the program
memory image (type 4, address 0). It is made from an assembler
.lodtext file bySNDReadDSPfile()and is a program, not audio. - 21 and 22: the first big-endian integer of the data is the sample count (layout of 21).
- 16, display: 16-bit words, used by
SoundViewand never played. - 29, delta µ-law: one byte a sample; no decoder is in the source.
- 9, nested: the constant is defined and used nowhere: no SoundKit, MusicKit or SndKit routine reads, writes or tests for it, so no layout exists in any source.
- 28, AES: the only use is as one of the five values a sound stream’s data-encoding parameter can take (linear 16, linear 8, µ-law, A-law and AES), next to an AES stream source and sink that name the AES/EBU digital audio connector; there is no code for a sound file in this encoding.
- 30 to 33, MusicKit:
SndFormats.hadds MP3, AAC, AC-3 and Vorbis after 29. The SndKit uses only 30, as the in-memory format of anSndMP3object, which is loaded from a plain MP3 file; nothing reads or writes a sound file with 30 to 33.
DSP commands (codes 21 and 22)
A Music Kit performance can be recorded as the Mach messages it sent to the sound/DSP driver; playing the file sends them again, so the DSP synthesises the sound afresh, in real time. The sound header has 2 channels and the rate 22050 or 44100. The data is a 16-byte subheader, four big-endian 32-bit integers, then the messages:
| Offset | Field | Meaning |
|---|---|---|
| 0 | sampleCount | the length of the performance in samples (the end time stamp); the SoundKit reports it as the sound’s sample count for codes 21 and 22 |
| 4 | dspBufSize | the DSP buffer size in words the commands were recorded with; the player uses it as its DMA size |
| 8 | soundoutBufSize | the sound-out buffer size in bytes |
| 12 | reserved | 0 |
| 16 | messages | driver messages one after another, each as the driver received it (message header and DSP words); the data size covers them |
Only code 21 can be played, and only through a DSP. Code 22 is described as code 21 with samples that stream to read-data unit generators on the DSP, to mix a recorded sound with the music; its sample count is read like code 21’s and nothing else about its data is defined. The explorer shows the subheader and the length of a code 21 sound and the sample count of a code 22 sound, and does not play either: they hold DSP programs and commands, not samples.
Compressed sounds (codes 19 and 20)
NeXT’s soundstruct.h says the data of a compressed sound starts with a
compression subheader of five 32-bit integers, in the file’s byte order:
| Offset | Field | Meaning |
|---|---|---|
| 0 | originalSize | size in bytes of the sound before compression |
| 4 | method | 0 SND_CFORMAT_BITS_DROPPED, 1 SND_CFORMAT_BIT_FAITHFUL, 2 SND_CFORMAT_ATC (Audio Transform Compression) |
| 8 | numDropped | for method 0, the number of bits dropped |
| 12 | encodeLength | uncompressed samples per encoded block |
| 16 | reserved |
The coded data follows the subheader to the end of the sound. Its layout depends on method: 2 is a stream
of ATC frames (below), 0 and 1 are blocks of Parallel Packing (below). Samples
are 16-bit and the decoded sound has originalSize / 2 samples counting every channel. The coders are
lossy for methods 0 and 2 and exact for method 1.
The NeXT sndcompress manual (NEXTSTEP 2.2 and 3.2) adds what the methods mean in use:
“bit-faithful” compression is lossless (decompression reproduces the original sound exactly), the lossy
kind takes an amount from 4 to 8 (-n), and from release 3 ATC is the default with
-l asking for lossless. Only 16-bit linear sounds are compressed.
The explorer decodes all three methods and plays the whole sound; the tree shows the subheader and every ATC frame or Parallel Packing block (in groups of 256, so a long sound is still a short list).
ATC frames (method 2)
Audio Transform Compression cuts the sound into frames of 512 samples that start every 256 samples
(ATC_FRAME_SIZE, a “step”). A frame is windowed with a sine window, transformed to 257 spectral values by a cosine
transform (frames 0, 2, 4, …) or a sine transform (frames 1, 3, …), and each value is kept to 4 bits. Adding the overlapping halves
of neighbouring frames cancels the aliasing of the transforms. A stereo sound has the left frame and the right frame of each step one
after the other; mono has one frame a step. Edits must keep pairs of frames together because of the alternation. A step is 256
samples a channel, and a sound of n samples a channel has ceil(n / 256) steps.
| Offset | Size | Meaning |
|---|---|---|
| 0 | 1 | the length of the frame in bytes, this byte included (at most 255; the data ends at a frame of length 0) |
| 1 | 1 | the frame exponent, 0 to 15; 16 or more marks a silent frame, which is these two bytes only (the header’s “peak level”: the amplitude is about 32767 >> exponent) |
| 2 | 20 | the exponents of the 40 bands, 4 bits each, the first band in the high nibble |
| 22 | 32 | 16 presence words, 16 bits big-endian each; bit b of word w says bin 16w + b (of bins 0 to 255) has a mantissa; bin 256 is always 0 |
| 54 | varies | the mantissas of the present bins in bin order, 4 bits each, signed, packed into 16-bit big-endian words from the top bit down (4 to a word); the last word is padded |
The 40 bands follow the critical bands of hearing: bands 0 to 11 are one bin each (bins 0 to 11), then widths of 2 (bins 12 to 21), 3 (22 to 30), 4, 5, 6, 7 and on to 20, and the last band is 13 bins wide (bins 244 to 256). Their start bins are 0 to 12, 14, 16, 18, 20, 22, 25, 28, 31, 35, 39, 44, 49, 55, 62, 70, 79, 89, 100, 112, 125, 139, 154, 170, 187, 205, 224 and 244.
Decoding a frame:
- Take each present bin’s mantissa as a signed 32-bit value with the 4 bits at the top, and shift it right (arithmetic) by its band’s exponent plus the frame exponent. Absent bins are 0.
- Shift right by 7 more to get 16.16 fixed-point values X[0..256].
- Inverse-transform: for a cosine frame form Y[i] = X[i]·cosi for i = 0 to 256 and Y[511 − i] = X[1 + i]·sin1+i for i = 0 to 254; for a sine frame use sin for the first and −cos for the second. The phasors are cos and sin of k·2π·128.5/512 (the angle accumulated step by step). Then run the inverse real FFT (split radix, 512 points, with the result shifted right by 9).
- Multiply by the sine window sin((i + ½)π/512), then by 2, and keep the low 16 bits.
- The frame’s first 256 samples are added to the previous frame’s last 256 (clipped to −32768..32767) to give a step of output; its last 256 wait for the next frame. The first step has no previous frame: it is the first frame’s first half alone and carries its aliasing.
All of it is 32-bit integer arithmetic; a product of two values is (a × b) >> 16 of the exact 64-bit product.
The viewer’s port equals NeXT’s C decoder (built from the SoundKit source) sample for sample on every sound tried, mono and stereo,
from 1 to 30,000 samples.
The DSP decoder
The description above is NeXT’s C decoder. NeXT’s sound board ran the same frames through a DSP56001 program (atd_dsp:
atd_spec.asm, atd_util.asm, atd_macros.asm, atd_mem.asm in the Darwin 0.1 SoundKit). It reads a frame word by word (16-bit words, the first holding the
frame length and the frame exponent), unpacks the mantissas to the top four bits of a 24-bit word, scales every band by its exponent and the gain (the default gain 1.0 is sent as the 24-bit
fraction 1/16, $100000), multiplies by the sine and cosine tables of the transform that matches the frame number (odd frame number: cosine, which is the C decoder’s frame 0, 2, 4, …),
splits the real sequence into two halves, runs a 256-point complex radix-2 FFT in place (Motorola’s fftr2d, with the DSP’s ROM sine table, results in bit-reversed order), applies the 512-point sine
window, scales by the frame exponent (14 is no scaling; below 14 a left shift that limits at 24 bits; above it a right shift), and overlap-adds: a frame’s first 256 words plus the previous frame’s last 256 are
limited to 24 bits and shifted down 8 bits (a floor) to make the 16-bit samples. The tables are assembled by create_window, sincosgen and create_phasors with the assembler’s
constant π = 3.141592654, rounded to 24 bits. All arithmetic is the DSP’s: 24-bit words, 56-bit accumulators, products doubled, MPYR rounding to even on an exact tie. Its output differs from the C decoder’s by noise of about
0.2 to 0.4% and it limits where the C code wraps. The viewer’s option “As the NeXT DSP played it” decodes this way, and equals the DSP program run on a DSP56001 core sample for sample
(AU, Not described, and parser-test/test-atcdsp.mjs).
Parallel Packing blocks (methods 0 and 1)
The sound is cut into blocks of encodeLength samples a channel (256 or 512). A block is every channel’s packed block in
turn: a byte code (0 to 10), a byte bits (0 to 16), then the data, padded to an even length. Each sample was shifted right by
numDropped bits (4 to 8) before packing. In method 1 (bit-faithful) the dropped bits stay in the low bits of every packed
value, so decoding is exact; in method 0 they are lost and decoding shifts the samples back left, with zeros below.
A block’s samples are predicted from the ones before it by a fixed difference formula (code); the first few are stored raw as 16-bit big-endian words and the rest as bits-bit fields, most significant bit first, whose top bit is a sign (value = −(field without the sign bit) when it is set). a is the decoded field and s the sample:
| Code | Raw samples | Sample |
|---|---|---|
| 0 | all | sj as stored |
| 1 | 1 | sj = sj−1 xor field (no sign) |
| 2 | 1 | sj−1 − a |
| 3 | 2 | a + 2sj−1 − sj−2 |
| 4 | 3 | −a + 3sj−1 − 3sj−2 + sj−3 |
| 5 | 4 | a + 4sj−1 − 6sj−2 + 4sj−3 − sj−4 |
| 6 | 3 | −a + sj−1 − sj−2 + sj−3 |
| 7 | 3 | −a + 2sj−1 − 2sj−2 + sj−3 |
| 8 | 4 | a + 2sj−1 − 2sj−2 + 2sj−3 − sj−4 |
| 9 | 4 | a + 3sj−1 − 4sj−2 + 3sj−3 − sj−4 |
| 10 | 4 | a + sj−1 + sj−3 − sj−4 |
The size of a channel block after its two header bytes is 2 × raw samples + ⌈bits × (encodeLength − raw samples) / 8⌉
bytes (for code 0, 2 × encodeLength), plus a pad byte if that is odd. In a bit-faithful block bits counts the dropped bits, and the sign bit
is bit bits − numDropped − 1 of the field. The samples are 16-bit values computed modulo 65536. The viewer’s port equals NeXT’s C decoder sample for sample,
and a bit-faithful sound decodes to the original exactly.
NeXT’s named sample rates
NeXT’s soundstruct.h names the rates its hardware supports directly:
SND_RATE_CODEC 8012.8210513 Hz (the codec rate),SND_RATE_LOW 22050, SND_RATE_HIGH 44100
and SND_RATE_LOW_PC 11025. The header field is an integer, so the codec rate appears as 8012.
Source: codes 0 to 29 and the compression subheader: NeXT’s soundstruct.h (SND_FORMAT_*, SNDCompressionSubheader, SND_CFORMAT_*, ATC_FRAME_SIZE 256); codes 28 to 33: MusicKit’s SndFormats.h; Sun’s encodings 1 to 8, 10 to 14, 18 to 21 and 23 to 27: usr/src/head/audio/au.h (same numbers as NeXT’s). Every code and name in the table was compared with these headers by script. Layouts of the compressed and ADPCM codes come from the NeXT SoundKit and the Sun reference code, as the text says; the ITU recommendations G.721, G.722 and G.723 themselves were not read for this page.