Add FS #10214. Initial commit of the original PDa code for the GSoC Pure Data plugin...
[kugel-rb.git] / apps / plugins / pdbox / PDa / intern / sformat.h
blobb75ef98c9a457b393870f9621a2a3094303dbb47
2 #ifndef SFORMAT_H__
3 #define SFORMAT_H__
5 typedef unsigned short uint16;
6 typedef unsigned long uint32;
8 #define FORMAT_WAVE 0
9 #define FORMAT_AIFF 1
10 #define FORMAT_NEXT 2
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 */
23 } t_nextstep;
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;
37 typedef struct _wave
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 */
52 } t_wave;
55 #endif
57 #ifndef SFORMAT_H__
58 #define SFORMAT_H__
60 typedef unsigned short uint16;
61 typedef unsigned long uint32;
63 #define FORMAT_WAVE 0
64 #define FORMAT_AIFF 1
65 #define FORMAT_NEXT 2
67 /* the NeXTStep sound header structure; can be big or little endian */
69 typedef struct _nextstep
71 char ns_fileid[4]; /* magic number '.snd' if file is big-endian */
72 uint32 ns_onset; /* byte offset of first sample */
73 uint32 ns_length; /* length of sound in bytes */
74 uint32 ns_format; /* format; see below */
75 uint32 ns_sr; /* sample rate */
76 uint32 ns_nchans; /* number of channels */
77 char ns_info[4]; /* comment */
78 } t_nextstep;
80 #define NS_FORMAT_LINEAR_16 3
81 #define NS_FORMAT_LINEAR_24 4
82 #define NS_FORMAT_FLOAT 6
83 #define SCALE (1./(1024. * 1024. * 1024. * 2.))
85 /* the WAVE header. All Wave files are little endian. We assume
86 the "fmt" chunk comes first which is usually the case but perhaps not
87 always; same for AIFF and the "COMM" chunk. */
89 typedef unsigned word;
90 typedef unsigned long dword;
92 typedef struct _wave
94 char w_fileid[4]; /* chunk id 'RIFF' */
95 uint32 w_chunksize; /* chunk size */
96 char w_waveid[4]; /* wave chunk id 'WAVE' */
97 char w_fmtid[4]; /* format chunk id 'fmt ' */
98 uint32 w_fmtchunksize; /* format chunk size */
99 uint16 w_fmttag; /* format tag, 1 for PCM */
100 uint16 w_nchannels; /* number of channels */
101 uint32 w_samplespersec; /* sample rate in hz */
102 uint32 w_navgbytespersec; /* average bytes per second */
103 uint16 w_nblockalign; /* number of bytes per sample */
104 uint16 w_nbitspersample; /* number of bits in a sample */
105 char w_datachunkid[4]; /* data chunk id 'data' */
106 uint32 w_datachunksize; /* length of data chunk */
107 } t_wave;
110 #endif