5 typedef unsigned short uint16
;
6 typedef unsigned long uint32
;
12 /* the NeXTStep sound header structure; can be big or little endian */
14 typedef struct _nextstep
16 char ns_fileid
[4]; /* magic number '.snd' if file is big-endian */
17 uint32 ns_onset
; /* byte offset of first sample */
18 uint32 ns_length
; /* length of sound in bytes */
19 uint32 ns_format
; /* format; see below */
20 uint32 ns_sr
; /* sample rate */
21 uint32 ns_nchans
; /* number of channels */
22 char ns_info
[4]; /* comment */
25 #define NS_FORMAT_LINEAR_16 3
26 #define NS_FORMAT_LINEAR_24 4
27 #define NS_FORMAT_FLOAT 6
28 #define SCALE (1./(1024. * 1024. * 1024. * 2.))
30 /* the WAVE header. All Wave files are little endian. We assume
31 the "fmt" chunk comes first which is usually the case but perhaps not
32 always; same for AIFF and the "COMM" chunk. */
34 typedef unsigned word
;
35 typedef unsigned long dword
;
39 char w_fileid
[4]; /* chunk id 'RIFF' */
40 uint32 w_chunksize
; /* chunk size */
41 char w_waveid
[4]; /* wave chunk id 'WAVE' */
42 char w_fmtid
[4]; /* format chunk id 'fmt ' */
43 uint32 w_fmtchunksize
; /* format chunk size */
44 uint16 w_fmttag
; /* format tag, 1 for PCM */
45 uint16 w_nchannels
; /* number of channels */
46 uint32 w_samplespersec
; /* sample rate in hz */
47 uint32 w_navgbytespersec
; /* average bytes per second */
48 uint16 w_nblockalign
; /* number of bytes per sample */
49 uint16 w_nbitspersample
; /* number of bits in a sample */
50 char w_datachunkid
[4]; /* data chunk id 'data' */
51 uint32 w_datachunksize
; /* length of data chunk */