summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/PDa/intern/sformat.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pdbox/PDa/intern/sformat.h')
-rw-r--r--apps/plugins/pdbox/PDa/intern/sformat.h110
1 files changed, 110 insertions, 0 deletions
diff --git a/apps/plugins/pdbox/PDa/intern/sformat.h b/apps/plugins/pdbox/PDa/intern/sformat.h
new file mode 100644
index 0000000000..b75ef98c9a
--- /dev/null
+++ b/apps/plugins/pdbox/PDa/intern/sformat.h
@@ -0,0 +1,110 @@
1
2#ifndef SFORMAT_H__
3#define SFORMAT_H__
4
5typedef unsigned short uint16;
6typedef unsigned long uint32;
7
8#define FORMAT_WAVE 0
9#define FORMAT_AIFF 1
10#define FORMAT_NEXT 2
11
12/* the NeXTStep sound header structure; can be big or little endian */
13
14typedef struct _nextstep
15{
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;
24
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.))
29
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. */
33
34typedef unsigned word;
35typedef unsigned long dword;
36
37typedef struct _wave
38{
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;
53
54
55#endif
56
57#ifndef SFORMAT_H__
58#define SFORMAT_H__
59
60typedef unsigned short uint16;
61typedef unsigned long uint32;
62
63#define FORMAT_WAVE 0
64#define FORMAT_AIFF 1
65#define FORMAT_NEXT 2
66
67/* the NeXTStep sound header structure; can be big or little endian */
68
69typedef struct _nextstep
70{
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;
79
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.))
84
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. */
88
89typedef unsigned word;
90typedef unsigned long dword;
91
92typedef struct _wave
93{
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;
108
109
110#endif