Source code of Windows XP (NT5)
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.

386 lines
9.4 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. tapiaud.h
  5. Abstract:
  6. This module contains the definition of interfaces to the audio related
  7. filters.
  8. Author:
  9. Mu Han (muhan) May-15-1999
  10. --*/
  11. #ifndef __tapiaud_h__
  12. #define __tapiaud_h__
  13. #include <mmreg.h>
  14. #include <dsound.h>
  15. #include "tapiqc.h"
  16. // CLSIDs for the audio filters
  17. struct DECLSPEC_UUID("581d09e5-0b45-11d3-a565-00c04f8ef6e3") TAPIAudioCapture;
  18. struct DECLSPEC_UUID("8d5c6cb6-0b44-4a5a-b785-44c366d4e677") TAPIAudioEncoder;
  19. struct DECLSPEC_UUID("65439c20-604f-49ca-aa82-dc01a10af171") TAPIAudioDecoder;
  20. struct DECLSPEC_UUID("ad4e63da-c3ef-408f-8153-0fc7d5c29f72") TAPIAudioMixer;
  21. struct DECLSPEC_UUID("44a3b142-cf81-42ea-b4d1-f43dd6f64ece") TAPIAudioRender;
  22. struct DECLSPEC_UUID("3878e189-cfb5-4e75-bd92-3686ee6e6634") TAPIAudioPluginDecoder;
  23. struct DECLSPEC_UUID("613ebf9e-c765-446f-bf96-7728ce579282") TAPIAudioDuplexController;
  24. // It is really bad that we had to do this here.
  25. struct DECLSPEC_UUID("b0210783-89cd-11d0-af08-00a0c925cd16") IDirectSoundNotify;
  26. struct DECLSPEC_UUID("279AFA83-4981-11CE-A521-0020AF0BE560") IDirectSound;
  27. struct DECLSPEC_UUID("C50A7E93-F395-4834-9EF6-7FA99DE50966") IDirectSound8;
  28. struct DECLSPEC_UUID("b0210781-89cd-11d0-af08-00a0c925cd16") IDirectSoundCapture;
  29. struct DECLSPEC_UUID("b0210782-89cd-11d0-af08-00a0c925cd16") IDirectSoundCaptureBuffer;
  30. struct DECLSPEC_UUID("279AFA85-4981-11CE-A521-0020AF0BE560") IDirectSoundBuffer;
  31. // the data structure to describe a audio device.
  32. typedef interface tagAudioDeviceInfo
  33. {
  34. UINT WaveID;
  35. GUID DSoundGUID;
  36. WCHAR szDeviceDescription[MAX_PATH];
  37. } AudioDeviceInfo, *PAudioDeviceInfo;
  38. // device enumeration functions exposed by the tapi audio capture dll.
  39. typedef HRESULT (WINAPI *PFNAudioGetDeviceInfo)(
  40. OUT DWORD * pdwNumDevices,
  41. OUT AudioDeviceInfo ** ppDeviceInfo
  42. );
  43. typedef HRESULT (WINAPI *PFNAudioReleaseDeviceInfo)(
  44. IN AudioDeviceInfo * ppDeviceInfo
  45. );
  46. // This interface is supported by the duplex controller. It only supports
  47. // dsound now.
  48. typedef enum EFFECTS
  49. {
  50. EFFECTS_AEC = 0,
  51. EFFECTS_AGC,
  52. EFFECTS_NS,
  53. EFFECTS_LAST
  54. } EFFECTS;
  55. interface DECLSPEC_UUID("864551a0-a822-48d7-a193-ddaa1c43d242") DECLSPEC_NOVTABLE
  56. IAudioDuplexController : public IUnknown
  57. {
  58. STDMETHOD (SetCaptureBufferInfo) (
  59. IN GUID * pDSoundCaptureGUID,
  60. IN DSCBUFFERDESC * pDescription
  61. ) PURE;
  62. STDMETHOD (SetRenderBufferInfo) (
  63. IN GUID * pDSoundRenderGUID,
  64. IN DSBUFFERDESC * pDescription,
  65. IN HWND hWindow,
  66. IN DWORD dwCooperateLevel
  67. ) PURE;
  68. STDMETHOD (EnableEffects) (
  69. IN DWORD dwNumberEffects,
  70. IN EFFECTS * pEffects,
  71. IN BOOL * pfEnable
  72. );
  73. STDMETHOD (GetCaptureDevice) (
  74. LPLPDIRECTSOUNDCAPTURE ppDSoundCapture,
  75. LPLPDIRECTSOUNDCAPTUREBUFFER ppCaptureBuffer
  76. ) PURE;
  77. STDMETHOD (GetRenderDevice) (
  78. LPLPDIRECTSOUND ppDirectSound,
  79. LPLPDIRECTSOUNDBUFFER ppRenderBuffer
  80. ) PURE;
  81. STDMETHOD (ReleaseCaptureDevice) () PURE;
  82. STDMETHOD (ReleaseRenderDevice) () PURE;
  83. STDMETHOD (GetEffect) (
  84. IN EFFECTS Effect,
  85. OUT BOOL *pfEnabled
  86. );
  87. };
  88. // the device configuration interface on teh tapi audio capture filter.
  89. interface DECLSPEC_UUID("3a12e2c1-1265-11d3-a56d-00c04f8ef6e3") DECLSPEC_NOVTABLE
  90. IAudioDeviceConfig : public IUnknown
  91. {
  92. STDMETHOD (SetDeviceID) (
  93. IN REFGUID pDSoundGUID,
  94. IN UINT uiWaveID
  95. ) PURE;
  96. STDMETHOD (SetDuplexController) (
  97. IN IAudioDuplexController * pIAudioDuplexController
  98. ) PURE;
  99. };
  100. #if !defined(STREAM_INTERFACES_DEFINED)
  101. typedef enum tagAudioDeviceProperty
  102. {
  103. AudioDevice_DuplexMode,
  104. AudioDevice_AutomaticGainControl,
  105. AudioDevice_AcousticEchoCancellation
  106. } AudioDeviceProperty;
  107. #endif
  108. // IAudioDeviceControl interface.
  109. interface DECLSPEC_UUID("3a12e2c2-1265-11d3-a56d-00c04f8ef6e3") DECLSPEC_NOVTABLE
  110. IAudioDeviceControl : public IUnknown
  111. {
  112. STDMETHOD (GetRange) (
  113. IN AudioDeviceProperty Property,
  114. OUT long *plMin,
  115. OUT long *plMax,
  116. OUT long *plSteppingDelta,
  117. OUT long *plDefault,
  118. OUT TAPIControlFlags *plFlags
  119. ) PURE;
  120. STDMETHOD (Get) (
  121. IN AudioDeviceProperty Property,
  122. OUT long *plValue,
  123. OUT TAPIControlFlags *plFlags
  124. ) PURE;
  125. STDMETHOD (Set) (
  126. IN AudioDeviceProperty Property,
  127. IN long lValue,
  128. IN TAPIControlFlags lFlags
  129. ) PURE;
  130. };
  131. // IAudioAutoPlay interface
  132. interface DECLSPEC_UUID("c5e7c28f-1446-4ebe-b7fc-72f599a72663") DECLSPEC_NOVTABLE
  133. IAudioAutoPlay : public IUnknown
  134. {
  135. STDMETHOD (StartAutoPlay) (IN BOOL fRun) PURE;
  136. STDMETHOD (StopAutoPlay) () PURE;
  137. };
  138. // IAudioEffectControl interface
  139. interface DECLSPEC_UUID("8eb9f108-3447-4fee-a705-6c6cf35c660c") DECLSPEC_NOVTABLE
  140. IAudioEffectControl : public IUnknown
  141. {
  142. // if enabled and AEC, use DSound AGC
  143. STDMETHOD (SetDsoundAGC) (IN BOOL fEnable) PURE;
  144. // if enabled and no AEC, revert gain to previous volume
  145. STDMETHOD (SetGainIncRevert) (IN BOOL fEnable) PURE;
  146. STDMETHOD (SetFixedMixLevel) (IN DOUBLE dLevel) PURE;
  147. };
  148. // IBasicAudioEx interface
  149. interface DECLSPEC_UUID("9c31055a-24bd-4ac1-be2b-ebe7ce89890c") DECLSPEC_NOVTABLE
  150. IBasicAudioEx : public IUnknown
  151. {
  152. STDMETHOD (SetMute) (IN BOOL fMute) PURE;
  153. STDMETHOD (GetMute) (OUT LPBOOL pfMute) PURE;
  154. };
  155. // IAudioDTMFControl interface
  156. interface DECLSPEC_UUID("dd1f3c26-5524-4d77-9fb2-7df5d62ffd87") DECLSPEC_NOVTABLE
  157. IAudioDTMFControl : public IUnknown
  158. {
  159. STDMETHOD (SendDTMFEvent) (
  160. IN DWORD dwEvent
  161. ) PURE;
  162. };
  163. // IAudioStatistics
  164. interface DECLSPEC_UUID("20fc7641-f3b2-4384-96ad-bf3d986e8751") DECLSPEC_NOVTABLE
  165. IAudioStatistics : public IUnknown
  166. {
  167. STDMETHOD (GetAudioLevel) (OUT LPLONG plAudioLevel) PURE;
  168. STDMETHOD (GetAudioLevelRange) (
  169. OUT LPLONG plMin,
  170. OUT LPLONG plMax
  171. ) PURE;
  172. };
  173. // ISilenceControl interface
  174. interface DECLSPEC_UUID("8804b7e4-2ef4-489f-a31b-740ac4278304") DECLSPEC_NOVTABLE
  175. ISilenceControl : public IUnknown
  176. {
  177. STDMETHOD (SetSilenceDetection) (IN BOOL fEnable) PURE;
  178. STDMETHOD (GetSilenceDetection) (OUT LPBOOL pfEnable) PURE;
  179. STDMETHOD (SetSilenceCompression) (IN BOOL fEnable) PURE;
  180. STDMETHOD (GetSilenceCompression) (OUT LPBOOL pfEnable) PURE;
  181. STDMETHOD (GetAudioLevel) (
  182. OUT LPLONG plAudioLevel
  183. ) PURE;
  184. STDMETHOD (GetAudioLevelRange) (
  185. OUT LPLONG plMin,
  186. OUT LPLONG plMax,
  187. OUT LPLONG plSteppingDelta
  188. ) PURE;
  189. STDMETHOD (SetSilenceLevel) (
  190. IN LONG lSilenceLevel,
  191. IN TAPIControlFlags lFlags
  192. ) PURE;
  193. STDMETHOD (GetSilenceLevel) (
  194. OUT LPLONG plSilenceLevel,
  195. OUT TAPIControlFlags * pFlags
  196. ) PURE;
  197. STDMETHOD (GetSilenceLevelRange) (
  198. OUT LPLONG plMin,
  199. OUT LPLONG plMax,
  200. OUT LPLONG plSteppingDelta,
  201. OUT LPLONG plDefault,
  202. OUT TAPIControlFlags * pFlags
  203. ) PURE;
  204. };
  205. #define VAD_EVENTBASE (100000)
  206. // events for voice activity detection.
  207. typedef enum VAD_EVENT
  208. {
  209. VAD_TALKING,
  210. VAD_SILENCE
  211. } VAD_EVENT;
  212. #ifndef WAVEFORMATEX_RTPG711
  213. typedef struct {
  214. // Generic WAVEFORMATEX fields
  215. WAVEFORMATEX WaveFormatEx;
  216. // network specific field
  217. WORD wPacketDuration;
  218. // Reserved
  219. DWORD dwReserved[2];
  220. } WAVEFORMATEX_RTPG711, *PWAVEFORMATEX_RTPG711;
  221. #endif
  222. #ifndef WAVEFORMATEX_RTPG723_1
  223. typedef struct {
  224. // Generic WAVEFORMATEX fields
  225. WAVEFORMATEX WaveFormatEx;
  226. // network specific field
  227. WORD wPacketDuration;
  228. // Variable bitrate specific field
  229. WORD wSamplesPerBlock;
  230. // G.723.1 specific fields
  231. WORD fSilenceDetection:1;
  232. WORD fSilenceCompression:1;
  233. WORD fLowDataRate:1;
  234. WORD fReserved:13;
  235. // Reserved
  236. DWORD dwReserved[2];
  237. } WAVEFORMATEX_RTPG723_1, *PWAVEFORMATEX_RTPG723_1;
  238. #endif
  239. #ifndef WAVEFORMATEX_RTPDVI4
  240. typedef struct {
  241. // Generic WAVEFORMATEX fields
  242. WAVEFORMATEX WaveFormatEx;
  243. // network specific field
  244. WORD wPacketDuration;
  245. } WAVEFORMATEX_RTPDVI4, *PWAVEFORMATEX_RTPDVI4;
  246. #endif
  247. #ifndef WAVEFORMATEX_RTPSIREN
  248. /* WAVE form wFormatTag IDs (mmreg.h defines most of the tags) */
  249. #define WAVE_FORMAT_SIREN 0x3001
  250. typedef struct {
  251. // Generic WAVEFORMATEX fields
  252. WAVEFORMATEX WaveFormatEx;
  253. // network specific field
  254. WORD wPacketDuration;
  255. } WAVEFORMATEX_RTPSIREN, *PWAVEFORMATEX_RTPSIREN;
  256. #endif
  257. #ifndef WAVEFORMATEX_RTPG722_1
  258. #define WAVE_FORMAT_G722_1 0x3002
  259. typedef struct {
  260. // Generic WAVEFORMATEX fields
  261. WAVEFORMATEX WaveFormatEx;
  262. // network specific field
  263. WORD wPacketDuration;
  264. } WAVEFORMATEX_RTPG722_1, *PWAVEFORMATEX_RTPG722_1;
  265. #endif
  266. #ifndef WAVEFORMATEX_RTPMSAUDIO
  267. typedef struct {
  268. // Generic WAVEFORMATEX fields
  269. WAVEFORMATEX WaveFormatEx;
  270. // network specific field
  271. WORD wPacketDuration;
  272. } WAVEFORMATEX_RTPMSAUDIO, *PWAVEFORMATEX_RTPMSAUDIO;
  273. #endif
  274. #ifndef WAVEFORMATEX_RTPGSM
  275. typedef struct {
  276. // Generic WAVEFORMATEX fields
  277. WAVEFORMATEX WaveFormatEx;
  278. // network specific field
  279. WORD wPacketDuration;
  280. BOOL fMbone;
  281. } WAVEFORMATEX_RTPGSM, *PWAVEFORMATEX_RTPGSM;
  282. #endif
  283. // IEncoderSampleRateControl, a private interface for the test team.
  284. interface DECLSPEC_UUID("483f56a9-513f-4f8b-b0e5-bc6a7ba3f8b9") DECLSPEC_NOVTABLE
  285. IEncoderSampleRateControl : public IUnknown
  286. {
  287. STDMETHOD (GetSampleRate) (OUT DWORD *pdwSampleRate) PURE;
  288. STDMETHOD (SetSampleRate) (IN DWORD dwSampleRate) PURE;
  289. };
  290. #endif //__tapiaud_h__