home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser 2002 January / STC_CD_01_2002.iso / APP / TRAIL_PG / GEMJING / GEMJ136.LZH / Develop / snd.h < prev   
Text File  |  1997-02-02  |  3KB  |  67 lines

  1. #if !defined(__SND_AU__)
  2. #define __SND_AU__
  3.  
  4. /*
  5. * "big-endian"
  6. *         0       1       2       3
  7. *         +-------+-------+-------+-------+
  8. * 0       | 0x2e  | 0x73  | 0x6e  | 0x64  |       "magic" number
  9. *         +-------+-------+-------+-------+
  10. * 4       |                               |       data location
  11. *         +-------+-------+-------+-------+
  12. * 8       |                               |       data size
  13. *         +-------+-------+-------+-------+
  14. * 12      |                               |       data format (enum)
  15. *         +-------+-------+-------+-------+
  16. * 16      |                               |       sampling rate (int)
  17. *         +-------+-------+-------+-------+
  18. * 20      |                               |       channel count
  19. *         +-------+-------+-------+-------+
  20. * 24      |       |       |       |       |       (optional) info  
  21. *                                                 string
  22. *
  23. * 28 = minimum value for data location
  24. */
  25.  
  26. typedef struct {
  27.     long magic;               /* magic number SND_MAGIC */
  28.     long dataLocation;        /* offset or pointer to the data */
  29.     long dataSize;            /* number of bytes of data */
  30.     long dataFormat;          /* the data format code */
  31.     long samplingRate;        /* the sampling rate */
  32.     long channelCount;        /* the number of channels */
  33.     char info[4];            /* optional text information */
  34. } SNDSoundStruct;
  35.  
  36. #define SND_FORMAT_UNSPECIFIED    0  /* unspecified format */
  37. #define SND_FORMAT_MULAW_8            1  /* 8-bit mu-law samples */
  38. #define SND_FORMAT_LINEAR_8        2  /* 8-bit linear samples */
  39. #define SND_FORMAT_LINEAR_16        3  /* 16-bit linear samples */
  40. #define SND_FORMAT_LINEAR_24        4  /* 24-bit linear samples */
  41. #define SND_FORMAT_LINEAR_32        5  /* 32-bit linear samples */
  42. #define SND_FORMAT_FLOAT            6  /* floating-point samples */
  43. #define SND_FORMAT_DOUBLE            7  /* double-precision float samples */
  44. #define SND_FORMAT_INDIRECT        8  /* fragmented sampled data */
  45. #define SND_FORMAT_NESTED            9  /* ? */
  46. #define SND_FORMAT_DSP_CORE        10 /* DSP program */
  47. #define SND_FORMAT_DSP_DATA_8        11 /* 8-bit fixed-point samples */
  48. #define SND_FORMAT_DSP_DATA_16    12 /* 16-bit fixed-point samples */
  49. #define SND_FORMAT_DSP_DATA_24    13 /* 24-bit fixed-point samples */
  50. #define SND_FORMAT_DSP_DATA_32    14 /* 32-bit fixed-point samples */
  51. #define SND_FORMAT_DISPLAY            16 /* non-audio display data */
  52. #define SND_FORMAT_MULAW_SQUELCH    17 /* ? */
  53. #define SND_FORMAT_EMPHASIZED                18 /* 16-bit linear with emphasis */
  54. #define SND_FORMAT_COMPRESSED                19 /* 16-bit linear with compression */
  55. #define SND_FORMAT_COMPRESSED_EMPHASIZED    20 /* A combination of the two above */
  56. #define SND_FORMAT_DSP_COMMANDS                21 /* Music Kit DSP commands */
  57. #define SND_FORMAT_DSP_COMMANDS_SAMPLES    22 /* ? */
  58.  
  59. /* Some new ones supported by Sun.  This is all I currently know. --GvR */
  60.  
  61. #define SND_FORMAT_ADPCM_G721        23
  62. #define SND_FORMAT_ADPCM_G722        24
  63. #define SND_FORMAT_ADPCM_G723_3    25
  64. #define SND_FORMAT_ADPCM_G723_5    26
  65. #define SND_FORMAT_ALAW_8            27
  66.  
  67. #endif