home *** CD-ROM | disk | FTP | other *** search
/ CICA 1992 November / CICA_MS_Windows_CD-ROM_Walnut_Creek_November_1992.iso / win3 / sounds / soundr3b / dsound.h < prev    next >
Text File  |  1991-09-27  |  4KB  |  134 lines

  1. /* DSOUND.H 3.0 (c) 1991 Aaron Wallace
  2.  
  3. This file provides useful prototypes and constants
  4. for accessing DSOUND.DLL 3.0.  */
  5.  
  6. /* These are the hardware devices supported: */
  7.  
  8. #define    DS_INTERNAL    0
  9. #define    DS_SSOURCE    1
  10. #define    DS_SBLASTER    2
  11.  
  12. /* These constants can be used as the
  13.     defaults to PlaySound */    
  14.  
  15. #define DSOUND_DEF_FREQ        22000
  16. #define DSOUND_DEF_SAMPSIZE    0
  17. #define DSOUND_DEF_VOLUME    10
  18. #define DSOUND_DEF_SHIFT        4
  19.  
  20.  
  21. /* These are the "reserved" delay values
  22. that cause the use of either auto-detection
  23. or timer use.  Note that even if auto-detection
  24. is on (EDelayValue=DS_AUTO in WIN.INI),
  25. GetDelayValue() will return the actual
  26. delay value that was calculated, *not* the
  27. DS_AUTO constant. */
  28.  
  29. #define DS_TIMER        0
  30. #define DS_INVALID        65534
  31. #define DS_AUTO        65535
  32.  
  33.  
  34. /* These define the offsets of the header of 
  35.     the "simple" SOUNDER 1.0 file format. 
  36.     All values are words. */
  37.  
  38. #define     SND_SAMPSIZE_OFS    0
  39. #define     SND_FREQ_OFS        2
  40. #define    SND_VOLUME_OFS        4
  41. #define    SND_SHIFT_OFS        6
  42. #define    SND_SAMPLE_OFS        8
  43.  
  44.  
  45. /* These define the offsets of the various
  46.     fields of the Martin Hepperle .SND format,
  47.     as used in his SoundTool application. */
  48.  
  49. #define    MHSND_MAGIC_OFS    0
  50. #define    MHSND_RES_OFS        6
  51. #define    MHSND_LENGTH_OFS    8
  52. #define    MHSND_START_OFS    12
  53. #define    MHSND_END_OFS        16
  54. #define    MHSND_FREQ_OFS        20
  55. #define    MHSND_SAMPSIZE_OFS    22
  56. #define    MHSND_VOLUME_OFS    24
  57. #define    MHSND_SHIFT_OFS    26
  58. #define    MHSND_NAME_OFS        28
  59. #define    MHSND_SAMPLE_OFS    124
  60.  
  61.  
  62. /* This defines the in-memory sound
  63.     format used in LoadSoundFile and PlaySoundImage
  64.     functions.  Note that in allocating memory for
  65.     this structure, it reserves space for only one
  66.     sample byte. */
  67.      
  68.  
  69. typedef struct _SNDHeader {
  70.     HANDLE reserved;
  71.     long length;
  72.     long start;
  73.     long end;
  74.     unsigned frequency;
  75.     unsigned sampleSize;
  76.     unsigned volume;
  77.     unsigned shift;
  78.     char name[96];
  79.     char samples[1];
  80. } SNDHeader;
  81.  
  82. typedef SNDHeader far *LPSNDH;
  83.  
  84.  
  85. /* Error codes returned from PlaySoundFile.
  86.     OK indicates no error. */
  87.  
  88. #define DS_OK          0
  89. #define DS_FILEERROR    1
  90. #define DS_BADFORMAT    2
  91. #define DS_MEMERROR        3
  92.  
  93.  
  94. /* Magic values for the type parameter of
  95.     PlaySoundFile.  DS_GUESS will cause PSF to
  96.     try to guess the file's format, based on the
  97.     filename extension and/or header information. */
  98.  
  99. #define DS_GUESS 0
  100. #define DS_SND 1
  101. #define DS_MHSND 2
  102. #define DS_SOU 3
  103. #define DS_CANTDETECT 0 
  104.  
  105. /* These are the function prototypes for all public
  106. functions in DSOUND.DLL. */
  107.  
  108. int FAR PASCAL PlaySound(char huge *, DWORD, unsigned, unsigned, unsigned, unsigned);
  109. int FAR PASCAL SoundFileType(LPSTR);
  110. int FAR PASCAL PlaySoundImage(GLOBALHANDLE);
  111. int FAR PASCAL PlaySoundResource(HANDLE);
  112. long FAR PASCAL _llread(int, char huge *, long);
  113. long FAR PASCAL _llwrite(int, char huge *, long);
  114. int FAR PASCAL PlaySoundFile(LPSTR, int, unsigned, unsigned, unsigned, unsigned);
  115. GLOBALHANDLE FAR PASCAL LoadSoundImage(LPSTR, int, unsigned, unsigned, unsigned, unsigned);
  116. int FAR PASCAL FindBestDelay();
  117. int FAR PASCAL GetDSoundVersion();
  118. int FAR PASCAL GetDSoundVersionD(int);
  119. void FAR PASCAL SetDelayValue(unsigned);
  120. int FAR PASCAL GetDelayValue();
  121. void FAR PASCAL SetVolume(unsigned);
  122. int FAR PASCAL GetVolume();
  123. int FAR PASCAL GetShiftValue();
  124. void FAR PASCAL SetShiftValue(int);
  125. void FAR PASCAL AboutDSound();
  126. void FAR PASCAL AboutDSoundD(int);
  127. BOOL FAR PASCAL UpdateClock(BOOL);
  128. int FAR PASCAL GetSoundDevice();
  129. void FAR PASCAL SetSoundDevice(int);
  130. int FAR PASCAL GetSoundPort();
  131. void FAR PASCAL SetSoundPort(int);
  132.  
  133.  
  134.