home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 519b.lha / FZIFF / 8svx.h next >
C/C++ Source or Header  |  1991-06-09  |  2KB  |  70 lines

  1. /* 8svx.h  include file for IFF 8-bit sampled voices
  2.  *           essentially cribbed from EA IFF documentation
  3.  *           KEL 21-Feb-87
  4.  */
  5.  
  6. #ifndef I8SVX_H
  7.  
  8. #define I8SVX_H
  9.  
  10. #define ID_8SVX MakeID('8', 'S', 'V', 'X')
  11. #define ID_VHDR MakeID('V', 'H', 'D', 'R')
  12.  
  13. typedef LONG Fixed;        /* A fixed-point value, 16 bits to the left of the
  14.                          * point and 16 to the right.  A Fixed is a number
  15.                          * of 216ths, i.e. 65536ths. */
  16.  
  17. #define Unity 0x1000L        /* Unity = Fixed 1.0 = maximum volume */
  18.  
  19. /* sCompression: Choice of compression algorithm applied to the samples */
  20.  
  21. #define sCmpNone    0        /* not compressed */
  22. #define sCmpFibDelta 1        /* Fibonacci-delta encoding */
  23. /* can be more kinds in the future */
  24.  
  25. typedef struct {
  26.     ULONG oneShotHiSamples,    /* # samples in the high octave 1-shot part */
  27.     repeatHiSamples,        /* # samples in the high octave repeat part */
  28.     samplesPerHiCycle;        /* # samples/cycle in high octave, else 0 */
  29.     UWORD samplesPerSec;    /* data sampling rate */
  30.     UBYTE ctOctave,            /* # octaves of waveforms */
  31.     sCompression;            /* data compression technique used */
  32.     Fixed volume;            /* playback volume from 0 to Unity (full
  33.                              * volume).  Map this value into the output
  34.                              * hardware's dynamic range. */
  35.     } Voice8Header;
  36.  
  37. #define ID_NAME MakeID('N', 'A', 'M', 'E')
  38.     /* NAME chunk contains a CHAR [], the voice's name. */
  39.  
  40. #define ID_Copyright MakeID('(','c',')',' ')
  41.     /* "(c) " chunk contains a CHAR [], the FORM's copyright notice. */
  42.  
  43. #ifndef ID_AUTH
  44. #define ID_AUTH MakeID('A','U','T','H')
  45. #endif
  46.     /* AUTH chunk contains a CHAR [], the author's name. */
  47.  
  48. #define ID_ANNO MakeID('A', 'N', 'N', 'O')
  49.     /* ANNO chunk contains a CHAR [], author's text annotations. */
  50.  
  51. #define ID_ATAK MakeID('A', 'T', 'A', 'K')
  52. #define ID_RLSE MakeID('R', 'L', 'S', 'E')
  53.  
  54. typedef struct {
  55.     UWORD duration;        /* segment duration in milliseconds, > 0 */
  56.     Fixed dest;            /* destination volume factor */
  57.     } EGPoint;
  58.  
  59. /* ATAK and RLSE chunks contain an EGPoint[] piecewise-linear envelope. */
  60. /* The envelope defines a function of time returning Fixed values.  It's
  61.  * used to scale the nominal volume specified in the Voice8Header.    */
  62.  
  63. #define ID_BODY MakeID('B', 'O', 'D', 'Y')
  64.  
  65. /* BODY chunk contains a BYTE[], array of audio data samples. */
  66.  
  67. #endif
  68.  
  69. /* end of 8svx.h */
  70.