App endix B
File Formats
B.1 Audio Data File Formats
The following sections describe the audio data le formats used by the
naplay
and
narecord
programs. Note that information stored in these le formats may be
used for some of the default settings of the
naplay
program, such as sampling rate.
Format names are case-insensitive and may be abbreviated to a minimal length
non-ambiguous string. For playback, if a format is not specied on the command
line, then various heuristics will b e used to try to deduce the typ e of the le.
The
narecord
and
naplay
programs also have options that allow the data encoding
and precision to b e sp ecied, overriding the default for the particular le format.
B.1.1 Raw
The
raw
format consists of the audio data stored as a stream of 16 bit signed integers
using twos-complement encoding. The data is stored with the most signicantbyte
of eachinteger rst, regardless of the byte-ordering of the host computer. If stereo
data is stored in the le, then the left and rightchannels are intersp ersed starting
with the left channel. This format has no header and contains no information other
than the audio data. Dierent data enco dings and precisions can be obtained using
the
-e
and
-p
options to
narecord
or
naplay
.
B.1.2 Swap
This is identical to the
raw
format except that the byte-ordering of the integers is
reversed. Each 16 bit integer is stored with the least signicant byte rst. This
byte-ordering is most often found on DEC computers.