B.1 Audio Data File Formats 125
B.1.8 SPPACK
SPPACK is a signal-pro cessing system used at AT&T Bell Lab oratories. Files can
be read or written in this format using the
sppack
setting of the
-f
option to
naplay
or
narecord
. Only 16-bit, linear enco ding is supp orted.
B.1.9 Multi-Channel File Formats
The
dlmrec
and
dlmplay
programs deal with digital audio data with more than
twochannels of data. These programs use les stored with the multiple channels
interleaved either on a sample or a block basis. The sample-interleaved format
stores the data packed, most-signicant-bit rst, with no header, and the samples
organized as follows:
L
0
0
R
0
0
L
1
0
R
1
0
L
2
0
R
2
0
L
3
0
R
3
0
L
0
1
R
0
1
L
1
1
R
1
1
:::L
2
N
R
2
N
L
3
N
R
3
N
(B.1)
where
L
j
i
is the
j
-th left sample from
DAT-Link
+ unit
j
and
R
j
i
is the
j
-th right
sample.
The blo ck-interleaved format has a 512 byte header with the following structure:
struct BlockHeader {
unsigned int magic; /* Magic number (MAGIC_BLOCKHEADER) */
int nchannels; /* Number of audio channels in file */
int bufsamps; /* Number of samples in each block */
int precision; /* Precision of samples in bits */
int filler[124]; /* Make it 512 bytes */
};
#define MAGIC_BLOCKHEADER 0x424c4b45 /* "BLKE" */
All variables are stored using the host byte-order although the data is most-signicant-
byte rst. The magic numb er identies the le as a block-interleaved le;
nchannels
is the number of input channels that were used to make the recording;
bufsamps
species the number of samples that are stored from each
DAT-Link
before advanc-
ing to the next unit, and
precision
is the number of bits/sample.
Starting at byte 512 of the le, the rst
bufsize
pairs of samples from
DAT-Link
unit 0 are stored with the data packed. The left and right samples are stored
sample-by-sample interleaved. Following this is the data from unit 1, unit 2, etc.
until the rst
bufsize
samples from all
nports
units is stored. The sequence then
repeats until all samples are stored.