4 ** stolen from Olaf Barthels' aiff.dt
11 #include <exec/types.h>
15 UWORD exponent
; // Exponent, bit #15 is sign bit for mantissa
16 ULONG mantissa
[2]; // 64 bit mantissa
19 // Audio Interchange Format chunk data
21 #define ID_AIFF MAKE_ID('A', 'I', 'F', 'F')
23 #define ID_COMM MAKE_ID('C', 'O', 'M', 'M')
24 #define ID_SSND MAKE_ID('S', 'S', 'N', 'D')
26 // "COMM" chunk header
29 WORD numChannels
; // Number of channels
30 ULONG numSampleFrames
; // Number of sample frames
31 WORD sampleSize
; // Number of bits per sample point
32 extended sampleRate
; // Replay rate in samples per second
35 // "SSND" chunk header
38 ULONG offset
, // Offset to sound data, for block alignment
39 blockSize
; // Size of block data is aligned to
42 static void ulong2extended( ULONG value
, extended
*ex
)
44 ex
->exponent
= 31 + 16383;
46 while( ( value
& 0x80000000 ) == 0 )
53 ex
->mantissa
[0] = value
;