alsa.audio: Furter work on skeleton
[AROS.git] / workbench / devs / AHI / Drivers / Filesave / FileFormats.h
blobd6765551ce8cdad6bb65a8abb4a0546169937620
1 #ifndef AHI_Drivers_Filesave_FileFormats_h
2 #define AHI_Drivers_Filesave_FileFormats_h
4 #include <exec/types.h>
6 #if !defined( __mc68000__)
7 #pragma pack(2)
8 #endif
10 /******************************************************************************
11 ** 8SVX defs ******************************************************************
12 ******************************************************************************/
14 /* From Jerry Morrison and Steve Hayes, Electronic Arts */
16 #define ID_8SVX MAKE_ID('8', 'S', 'V', 'X')
17 #define ID_VHDR MAKE_ID('V', 'H', 'D', 'R')
18 #define ID_BODY MAKE_ID('B', 'O', 'D', 'Y')
20 /* sCompression: Choice of compression algorithm applied to the samples. */
21 #define sCmpNone 0 /* not compressed */
22 #define sCmpFibDelta 1 /* Fibonacci-delta encoding (Appendix C) */
23 /* Could be more kinds in the future. */
24 typedef struct {
25 ULONG oneShotHiSamples, /* # samples in the high octave 1-shot part */
26 repeatHiSamples, /* # samples in the high octave repeat part */
27 samplesPerHiCycle; /* # samples/cycle in high octave, else 0 */
28 UWORD samplesPerSec; /* data sampling rate */
29 UBYTE ctOctave, /* # of octaves of waveforms */
30 sCompression; /* data compression technique used */
31 Fixed volume; /* playback nominal volume from 0 to Unity
32 * (full volume). Map this value into
33 * the output hardware's dynamic range.
35 } Voice8Header;
37 /******************************************************************************
38 ** AIFF and AIFC defs *********************************************************
39 ******************************************************************************/
41 /* AIFF and AIFC defines were taken from Olaf `Olsen' Barthel's AIFF DataType. */
43 // 80 bit IEEE Standard 754 floating point number
45 typedef struct {
46 unsigned short exponent; // Exponent, bit #15 is sign bit for mantissa
47 unsigned long mantissa[2]; // 64 bit mantissa
48 } extended;
50 // Audio Interchange Format chunk data
52 #define ID_AIFF MAKE_ID('A','I','F','F')
53 #define ID_AIFC MAKE_ID('A','I','F','C')
55 #define ID_FVER MAKE_ID('F','V','E','R')
56 #define ID_COMM MAKE_ID('C','O','M','M')
57 #define ID_SSND MAKE_ID('S','S','N','D')
59 // "COMM" chunk header
61 typedef struct {
62 short numChannels; // Number of channels
63 unsigned long numSampleFrames; // Number of sample frames
64 short sampleSize; // Number of bits per sample point
65 extended sampleRate; // Replay rate in samples per second
66 } CommonChunk;
68 // The same for "AIFC" type files
70 #define NO_COMPRESSION MAKE_ID('N','O','N','E') // No sound compression
72 typedef struct {
73 short numChannels; // Number of channels
74 unsigned long numSampleFrames; // Number of sample frames
75 short sampleSize; // Number of bits per sample point
76 extended sampleRate; // Replay rate in samples per second
77 unsigned long compressionType; // Compression type
78 char compressionName[(sizeof("not compressed")+1)&(~1)];
79 } ExtCommonChunk;
82 // "SSND" chunk header
84 typedef struct {
85 unsigned long offset, // Offset to sound data, for block alignment
86 blockSize; // Size of block data is aligned to
87 } SampledSoundHeader;
89 // "FVER" chunk header
91 typedef struct {
92 long timestamp; // Format version creation date
93 } FormatVersionHeader;
95 #define AIFCVersion1 0xA2805140 // "AIFC" file format version #1
98 struct AIFCheader {
99 ULONG FORMid;
100 ULONG FORMsize;
101 ULONG AIFCid;
103 ULONG FVERid;
104 ULONG FVERsize;
105 FormatVersionHeader FVERchunk;
107 ULONG COMMid;
108 ULONG COMMsize;
109 ExtCommonChunk COMMchunk;
111 ULONG SSNDid;
112 ULONG SSNDsize;
113 SampledSoundHeader SSNDchunk;
116 struct AIFFheader {
117 ULONG FORMid;
118 ULONG FORMsize;
119 ULONG AIFFid;
121 ULONG COMMid;
122 ULONG COMMsize;
123 CommonChunk COMMchunk;
125 ULONG SSNDid;
126 ULONG SSNDsize;
127 SampledSoundHeader SSNDchunk;
130 struct EIGHTSVXheader {
131 ULONG FORMid;
132 ULONG FORMsize;
133 ULONG EIGHTSVXid;
135 ULONG VHDRid;
136 ULONG VHDRsize;
137 Voice8Header VHDRchunk;
139 ULONG BODYid;
140 ULONG BODYsize;
144 /******************************************************************************
145 ** WAV file format ************************************************************
146 ******************************************************************************/
148 #define ID_RIFF MAKE_ID('R','I','F','F')
149 #define ID_WAVE MAKE_ID('W','A','V','E')
150 #define ID_fmt MAKE_ID('f','m','t',' ')
151 #define ID_data MAKE_ID('d','a','t','a')
154 typedef struct {
155 unsigned short formatTag;
156 unsigned short numChannels;
157 unsigned long samplesPerSec;
158 unsigned long avgBytesPerSec;
159 unsigned short blockAlign;
160 unsigned short bitsPerSample;
161 } FormatChunk;
163 #define WAVE_PCM 1
166 struct WAVEheader {
167 ULONG FORMid;
168 ULONG FORMsize;
169 ULONG WAVEid;
171 ULONG FORMATid;
172 ULONG FORMATsize;
173 FormatChunk FORMATchunk;
175 ULONG DATAid;
176 ULONG DATAsize;
179 /******************************************************************************
180 ** S16 defs *******************************************************************
181 ******************************************************************************/
183 #include "Studio16file.h"
185 #if !defined( __mc68000__)
186 #pragma pack()
187 #endif
189 #endif /* AHI_Drivers_Filesave_FileFormats_h */