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.

164 lines
5.7 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. // pcm.h - interface to pcm functions in pcm.c
  24. ////
  25. #ifndef __PCM_H__
  26. #define __PCM_H__
  27. #include "winlocal.h"
  28. #include "wavfmt.h"
  29. #define PCM_VERSION 0x00000100
  30. // handle to pcm engine
  31. //
  32. DECLARE_HANDLE32(HPCM);
  33. // <dwFlags> param in PcmFilter and PcmConvert
  34. //
  35. #define PCMFILTER_LOWPASS 0x00000001
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. // PcmInit - initialize pcm engine
  40. // <dwVersion> (i) must be PCM_VERSION
  41. // <hInst> (i) instance handle of calling module
  42. // <dwFlags> (i) reserved; must be 0
  43. // return handle (NULL if error)
  44. //
  45. HPCM DLLEXPORT WINAPI PcmInit(DWORD dwVersion, HINSTANCE hInst, DWORD dwFlags);
  46. // PcmTerm - shut down pcm engine
  47. // <hPcm> (i) handle returned from PcmInit
  48. // return 0 if success
  49. //
  50. int DLLEXPORT WINAPI PcmTerm(HPCM hPcm);
  51. // PcmReset - reset pcm engine
  52. // <hPcm> (i) handle returned from PcmInit
  53. // return 0 if success
  54. //
  55. int DLLEXPORT WINAPI PcmReset(HPCM hPcm);
  56. // PcmCalcSizBufSrc - calculate source buffer size
  57. // <hPcm> (i) handle returned from PcmInit
  58. // <sizBufDst> (i) size of destination buffer in bytes
  59. // <lpwfxSrc> (i) source wav format
  60. // <lpwfxDst> (i) destination wav format
  61. // return source buffer size, -1 if error
  62. //
  63. long DLLEXPORT WINAPI PcmCalcSizBufSrc(HPCM hPcm, long sizBufDst,
  64. LPWAVEFORMATEX lpwfxSrc, LPWAVEFORMATEX lpwfxDst);
  65. // PcmCalcSizBufDst - calculate destination buffer size
  66. // <hPcm> (i) handle returned from PcmInit
  67. // <sizBufSrc> (i) size of source buffer in bytes
  68. // <lpwfxSrc> (i) source wav format
  69. // <lpwfxDst> (i) destination wav format
  70. // return destination buffer size, -1 if error
  71. //
  72. long DLLEXPORT WINAPI PcmCalcSizBufDst(HPCM hPcm, long sizBufSrc,
  73. LPWAVEFORMATEX lpwfxSrc, LPWAVEFORMATEX lpwfxDst);
  74. // PcmConvert - convert pcm data from one format to another
  75. // <hPcm> (i) handle returned from PcmInit
  76. // <hpBufSrc> (i) buffer containing bytes to reformat
  77. // <sizBufSrc> (i) size of buffer in bytes
  78. // <lpwfxSrc> (i) source wav format
  79. // <hpBufDst> (o) buffer to contain new format
  80. // <sizBufDst> (i) size of buffer in bytes
  81. // <lpwfxDst> (i) destination wav format
  82. // <dwFlags> (i) control flags
  83. // PCMFILTER_LOWPASS perform lowpass filter
  84. // return count of bytes in destination buffer (-1 if error)
  85. //
  86. // NOTE: the destination buffer must be large enough to hold the result
  87. //
  88. long DLLEXPORT WINAPI PcmConvert(HPCM hPcm,
  89. void _huge *hpBufSrc, long sizBufSrc, LPWAVEFORMATEX lpwfxSrc,
  90. void _huge *hpBufDst, long sizBufDst, LPWAVEFORMATEX lpwfxDst,
  91. DWORD dwFlags);
  92. // Pcm16To8 - convert 16-bit samples to 8-bit samples
  93. // <hPcm> (i) handle returned from PcmInit
  94. // <lppcm16Src> (i) buffer of source samples
  95. // <lppcm8Dst> (o) buffer to hold destination samples
  96. // <uSamples> (i) count of source samples to convert
  97. // return 0 if success
  98. //
  99. int DLLEXPORT WINAPI Pcm16To8(HPCM hPcm,
  100. LPPCM16 lppcm16Src, LPPCM8 lppcm8Dst, UINT uSamples);
  101. // Pcm8To16 - convert 8-bit samples to 16-bit samples
  102. // <hPcm> (i) handle returned from PcmInit
  103. // <lppcm8Src> (i) buffer of source samples
  104. // <lppcm16Dst> (o) buffer to hold destination samples
  105. // <uSamples> (i) count of source samples to convert
  106. // return 0 if success
  107. //
  108. int DLLEXPORT WINAPI Pcm8To16(HPCM hPcm,
  109. LPPCM8 lppcm8Src, LPPCM16 lppcm16Dst, UINT uSamples);
  110. // PcmFilter - filter pcm samples
  111. // <hPcm> (i) handle returned from PcmInit
  112. // <lppcm16Src> (i) buffer of source samples
  113. // <lppcm16Dst> (o) buffer to hold destination samples
  114. // <uSamples> (i) count of source samples to filter
  115. // <dwFlags> (i) control flags
  116. // PCMFILTER_LOWPASS perform a low pass filter
  117. // return 0 if success
  118. //
  119. // NOTE: <lppcm16Src> and <lppcm16Dst> can point to the same buffer
  120. //
  121. int DLLEXPORT WINAPI PcmFilter(HPCM hPcm,
  122. LPPCM16 lppcm16Src, LPPCM16 lppcm16Dst, UINT uSamples, DWORD dwFlags);
  123. // PcmResample - resample pcm samples
  124. // <hPcm> (i) handle returned from PcmInit
  125. // <lppcm16Src> (i) buffer of source samples
  126. // <nSamplesPerSecSrc> (i) sample rate of source samples
  127. // <lppcm16Dst> (o) buffer to hold destination samples
  128. // <nSamplesPerSecDst> (i) sample rate of destination samples
  129. // <uSamples> (i) count of source samples to resample
  130. // <dwFlags> (i) control flags
  131. // 0 reserved, must be zero
  132. // return count of samples in destination buffer (0 if error)
  133. //
  134. // NOTE: the destination buffer must be large enough to hold the result.
  135. // Call PcmResampleCalcDstMax() to calculate max destination samples
  136. //
  137. UINT DLLEXPORT WINAPI PcmResample(HPCM hPcm,
  138. LPPCM16 lppcm16Src, long nSamplesPerSecSrc,
  139. LPPCM16 lppcm16Dst, long nSamplesPerSecDst,
  140. UINT uSamples, DWORD dwFlags);
  141. #ifdef __cplusplus
  142. }
  143. #endif
  144. #endif // __PCM_H__