Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

285 lines
9.8 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998 Active Voice Corporation. All Rights Reserved.
  4. //
  5. // Active Agent(r) and Unified Communications(tm) are trademarks of Active Voice Corporation.
  6. //
  7. // Other brand and product names used herein are trademarks of their respective owners.
  8. //
  9. // The entire program and user interface including the structure, sequence, selection,
  10. // and arrangement of the dialog, the exclusively "yes" and "no" choices represented
  11. // by "1" and "2," and each dialog message are protected by copyrights registered in
  12. // the United States and by international treaties.
  13. //
  14. // Protected by one or more of the following United States patents: 5,070,526, 5,488,650,
  15. // 5,434,906, 5,581,604, 5,533,102, 5,568,540, 5,625,676, 5,651,054.
  16. //
  17. // Active Voice Corporation
  18. // Seattle, Washington
  19. // USA
  20. //
  21. /////////////////////////////////////////////////////////////////////////////////////////
  22. ////
  23. // wavfmt.h - interface for wav format functions in wavfmt.c
  24. ////
  25. #ifndef __WAVFMT_H__
  26. #define __WAVFMT_H__
  27. #include "winlocal.h"
  28. // 16-bit pcm sample
  29. //
  30. typedef __int16 PCM16;
  31. typedef PCM16 _huge *LPPCM16;
  32. // 8-bit pcm sample
  33. //
  34. typedef BYTE PCM8;
  35. typedef PCM8 _huge *LPPCM8;
  36. #include <mmsystem.h>
  37. #ifdef _WIN32
  38. #include <mmreg.h>
  39. #else
  40. #if 0 // this requires either the VFWDK or MDRK
  41. #include <mmreg.h>
  42. #else // this is copied from the WIN32 version of mmreg.h
  43. #ifndef _WAVEFORMATEX_
  44. #define _WAVEFORMATEX_
  45. typedef struct tWAVEFORMATEX
  46. {
  47. WORD wFormatTag; /* format type */
  48. WORD nChannels; /* number of channels (i.e. mono, stereo...) */
  49. DWORD nSamplesPerSec; /* sample rate */
  50. DWORD nAvgBytesPerSec; /* for buffer estimation */
  51. WORD nBlockAlign; /* block size of data */
  52. WORD wBitsPerSample; /* Number of bits per sample of mono data */
  53. WORD cbSize; /* The count in bytes of the size of
  54. extra information (after cbSize) */
  55. } WAVEFORMATEX;
  56. typedef WAVEFORMATEX *PWAVEFORMATEX;
  57. typedef WAVEFORMATEX NEAR *NPWAVEFORMATEX;
  58. typedef WAVEFORMATEX FAR *LPWAVEFORMATEX;
  59. #endif /* _WAVEFORMATEX_ */
  60. #ifndef _ACM_WAVEFILTER
  61. #define _ACM_WAVEFILTER
  62. #define WAVE_FILTER_UNKNOWN 0x0000
  63. #define WAVE_FILTER_DEVELOPMENT (0xFFFF)
  64. typedef struct wavefilter_tag {
  65. DWORD cbStruct; /* Size of the filter in bytes */
  66. DWORD dwFilterTag; /* filter type */
  67. DWORD fdwFilter; /* Flags for the filter (Universal Dfns) */
  68. DWORD dwReserved[5]; /* Reserved for system use */
  69. } WAVEFILTER;
  70. typedef WAVEFILTER *PWAVEFILTER;
  71. typedef WAVEFILTER NEAR *NPWAVEFILTER;
  72. typedef WAVEFILTER FAR *LPWAVEFILTER;
  73. #endif /* _ACM_WAVEFILTER */
  74. #ifndef WAVE_FORMAT_DIALOGIC_OKI_ADPCM
  75. #define WAVE_FORMAT_DIALOGIC_OKI_ADPCM 0x0017 /* Dialogic Corporation */
  76. #endif
  77. #ifndef MM_DIALOGIC
  78. #define MM_DIALOGIC 93 /* Dialogic Corporation */
  79. #endif
  80. #ifndef WAVE_FORMAT_MULAW
  81. #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
  82. #endif
  83. #endif
  84. #endif
  85. // issued 5/11/98 by Terri Hendry [email protected]
  86. //
  87. #ifndef MM_ACTIVEVOICE
  88. #define MM_ACTIVEVOICE 225
  89. #endif
  90. // issued 5/11/98 by Terri Hendry [email protected]
  91. //
  92. #ifndef MM_ACTIVEVOICE_ACM_VOXADPCM
  93. #define MM_ACTIVEVOICE_ACM_VOXADPCM 1
  94. #endif
  95. // $FIXUP - we need to register with Microsoft to get product id
  96. //
  97. #ifndef MM_ACTIVEVOICE_AVPHONE_WAVEOUT
  98. #define MM_ACTIVEVOICE_AVPHONE_WAVEOUT 2
  99. #endif
  100. // $FIXUP - we need to register with Microsoft to get product id
  101. //
  102. #ifndef MM_ACTIVEVOICE_AVPHONE_WAVEIN
  103. #define MM_ACTIVEVOICE_AVPHONE_WAVEIN 3
  104. #endif
  105. #define WAVFMT_VERSION 0x00000105
  106. #ifdef __cplusplus
  107. extern "C" {
  108. #endif
  109. // WavFormatPcm - fill WAVEFORMATEX struct based on PCM characteristics
  110. // <nSamplesPerSec> (i) sample rate
  111. // -1 default sample rate (11025)
  112. // <nBitsPerSample> (i) sample size
  113. // -1 default sample size (8)
  114. // <nChannels> (i) number of channels (1=mono, 2=stereo)
  115. // -1 default (mono)
  116. // <lpwfx> (o) pointer to output buffer
  117. // NULL allocate new buffer to hold result
  118. // return pointer to WAVEFORMATEX struct, NULL if error
  119. //
  120. // NOTE: if <lpwfx> points to a WAVEFORMATEX struct, this struct
  121. // is filled in, and this function returns <lpwfx>.
  122. // If <lpwfx> is NULL, space is dynamically allocated for the output
  123. // buffer, and this function returns a pointer to the output buffer.
  124. // Use WavFormatFree() to free the buffer.
  125. //
  126. LPWAVEFORMATEX DLLEXPORT WINAPI WavFormatPcm(long nSamplesPerSec,
  127. WORD nBitsPerSample, WORD nChannels, LPWAVEFORMATEX lpwfx);
  128. // WavFormatAlloc - allocate WAVEFORMATEX struct buffer
  129. // <cbSize> (i) size of struct, including extra bytes
  130. // return pointer to WAVEFORMATEX struct, NULL if error
  131. //
  132. // NOTE: use WavFormatFree() to free the buffer.
  133. //
  134. LPWAVEFORMATEX DLLEXPORT WINAPI WavFormatAlloc(WORD cbSize);
  135. // WavFormatDup - duplicate WAVEFORMATEX structure
  136. // <lpwfx> (i) pointer to WAVEFORMATEX struct
  137. // return pointer to new WAVEFORMATEX struct, NULL if error
  138. //
  139. // NOTE: use WavFormatFree() to free the buffer.
  140. //
  141. LPWAVEFORMATEX DLLEXPORT WINAPI WavFormatDup(LPWAVEFORMATEX lpwfx);
  142. // WavFormatFree - free WAVEFORMATEX struct
  143. // <lpwfx> (i) pointer returned from WavFormatAlloc/Dup/Pcm
  144. // return 0 if success
  145. //
  146. int DLLEXPORT WINAPI WavFormatFree(LPWAVEFORMATEX lpwfx);
  147. // WavFormatIsValid - check format for validity
  148. // <lpwfx> (i) pointer to WAVEFORMATEX struct
  149. // return TRUE if valid format
  150. //
  151. BOOL DLLEXPORT WINAPI WavFormatIsValid(LPWAVEFORMATEX lpwfx);
  152. // WavFormatCmp - compare one format with another
  153. // <lpwfx1> (i) pointer to WAVEFORMATEX struct
  154. // <lpwfx2> (i) pointer to WAVEFORMATEX struct
  155. // return 0 if identical
  156. //
  157. // NOTE: this function does NOT compare the cbSize field or the extra bytes
  158. //
  159. int DLLEXPORT WINAPI WavFormatCmp(LPWAVEFORMATEX lpwfx1, LPWAVEFORMATEX lpwfx2);
  160. // WavFormatCopy - copy one format to another
  161. // <lpwfxDst> (i) pointer to destination WAVEFORMATEX struct
  162. // <lpwfxSrc> (i) pointer to source WAVEFORMATEX struct
  163. // return 0 if success
  164. //
  165. // NOTE: this function does NOT copy the cbSize field or the extra bytes
  166. //
  167. int DLLEXPORT WINAPI WavFormatCopy(LPWAVEFORMATEX lpwfxDst, LPWAVEFORMATEX lpwfxSrc);
  168. // WavFormatGetSize - check size of format structure
  169. // <lpwfx> (i) pointer to WAVEFORMATEX struct
  170. // return size of structure, 0 if error
  171. //
  172. int DLLEXPORT WINAPI WavFormatGetSize(LPWAVEFORMATEX lpwfx);
  173. // WavFormatDump - dump WAVEFORMATEX struct to debug
  174. // <lpwfx> (i) pointer to WAVEFORMATEX struct
  175. // return 0 if success
  176. //
  177. int DLLEXPORT WINAPI WavFormatDump(LPWAVEFORMATEX lpwfx);
  178. // WavFormatBytesToMilleseconds - convert bytes to milleseconds
  179. // <lpwfx> (i) pointer to WAVEFORMATEX struct
  180. // <dwBytes> (i) bytes
  181. // return milleseconds
  182. //
  183. DWORD DLLEXPORT WINAPI WavFormatBytesToMilleseconds(LPWAVEFORMATEX lpwfx, DWORD dwBytes);
  184. // WavFormatMillesecondsToBytes - convert milleseconds to bytes
  185. // <lpwfx> (i) pointer to WAVEFORMATEX struct
  186. // <dwMilleseconds> (i) milleseconds
  187. // return milleseconds
  188. //
  189. DWORD DLLEXPORT WINAPI WavFormatMillesecondsToBytes(LPWAVEFORMATEX lpwfx, DWORD dwMilleseconds);
  190. // WavFormatSpeedAdjust - adjust format to reflect specified speed
  191. // <lpwfx> (i/o) pointer to WAVEFORMATEX struct
  192. // <nLevel> (i) speed level
  193. // 50 half speed
  194. // 100 normal speed
  195. // 200 double speed, etc.
  196. // <dwFlags> (i) reserved; must be zero
  197. // return 0 if success
  198. //
  199. int DLLEXPORT WINAPI WavFormatSpeedAdjust(LPWAVEFORMATEX lpwfx, int nLevel, DWORD dwFlags);
  200. // WavFormatVoxadpcm - fill WAVEFORMATEX struct for Dialogic OKI ADPCM
  201. // <lpwfx> (o) pointer to output buffer
  202. // NULL allocate new buffer to hold result
  203. // <nSamplesPerSec> (i) sample rate
  204. // -1 default sample rate (6000)
  205. // return pointer to WAVEFORMATEX struct, NULL if error
  206. //
  207. // NOTE: if <lpwfx> points to a WAVEFORMATEX struct, this struct
  208. // is filled in, and this function returns <lpwfx>.
  209. // If <lpwfx> is NULL, space is dynamically allocated for the output
  210. // buffer, and this function returns a pointer to the output buffer.
  211. // Use WavFormatFree() to free the buffer.
  212. //
  213. LPWAVEFORMATEX DLLEXPORT WINAPI WavFormatVoxadpcm(LPWAVEFORMATEX lpwfx, long nSamplesPerSec);
  214. // WavFormatMulaw - fill WAVEFORMATEX struct for CCITT u-law format
  215. // <lpwfx> (o) pointer to output buffer
  216. // NULL allocate new buffer to hold result
  217. // <nSamplesPerSec> (i) sample rate
  218. // -1 default sample rate (8000)
  219. // return pointer to WAVEFORMATEX struct, NULL if error
  220. //
  221. // NOTE: if <lpwfx> points to a WAVEFORMATEX struct, this struct
  222. // is filled in, and this function returns <lpwfx>.
  223. // If <lpwfx> is NULL, space is dynamically allocated for the output
  224. // buffer, and this function returns a pointer to the output buffer.
  225. // Use WavFormatFree() to free the buffer.
  226. //
  227. LPWAVEFORMATEX DLLEXPORT WINAPI WavFormatMulaw(LPWAVEFORMATEX lpwfx, long nSamplesPerSec);
  228. // WavFormatAlaw - fill WAVEFORMATEX struct for CCITT a-law format
  229. // <lpwfx> (o) pointer to output buffer
  230. // NULL allocate new buffer to hold result
  231. // <nSamplesPerSec> (i) sample rate
  232. // -1 default sample rate (8000)
  233. // return pointer to WAVEFORMATEX struct, NULL if error
  234. //
  235. // NOTE: if <lpwfx> points to a WAVEFORMATEX struct, this struct
  236. // is filled in, and this function returns <lpwfx>.
  237. // If <lpwfx> is NULL, space is dynamically allocated for the output
  238. // buffer, and this function returns a pointer to the output buffer.
  239. // Use WavFormatFree() to free the buffer.
  240. //
  241. LPWAVEFORMATEX DLLEXPORT WINAPI WavFormatAlaw(LPWAVEFORMATEX lpwfx, long nSamplesPerSec);
  242. #ifdef __cplusplus
  243. }
  244. #endif
  245. #endif // __WAV_H__