DirectSound.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:101k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. {******************************************************************************}
  2. {*                                                                            *}
  3. {*  Copyright (C) Microsoft Corporation.  All Rights Reserved.                *}
  4. {*                                                                            *}
  5. {*  Files:      dsound.h                                                      *}
  6. {*  Content:    DirectSound include file                                      *}
  7. {*                                                                            *}
  8. {*  DirectX 9.0 Delphi adaptation by Alexey Barkovoy                          *}
  9. {*  E-Mail: clootie@reactor.ru                                                *}
  10. {*                                                                            *}
  11. {*  Modified: 27-Apr-2003                                                     *}
  12. {*                                                                            *}
  13. {*  Compatible with :                                                         *}
  14. {*    DirectX 7.0 Object Pascal adaptation by                                 *}
  15. {*      Erik Unger, e-Mail: DelphiDirectX@next-reality.com                    *}
  16. {*                                                                            *}
  17. {*  Latest version can be downloaded from:                                    *}
  18. {*     http://clootie.narod.ru/delphi                                         *}
  19. {*                                                                            *}
  20. {******************************************************************************}
  21. {                                                                              }
  22. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  23. {                                                                              }
  24. { The contents of this file are used with permission, subject to the Mozilla   }
  25. { Public License Version 1.1 (the "License"); you may not use this file except }
  26. { in compliance with the License. You may obtain a copy of the License at      }
  27. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  28. {                                                                              }
  29. { Software distributed under the License is distributed on an "AS IS" basis,   }
  30. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  31. { the specific language governing rights and limitations under the License.    }
  32. {                                                                              }
  33. { Alternatively, the contents of this file may be used under the terms of the  }
  34. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  35. { provisions of the LGPL License are applicable instead of those above.        }
  36. { If you wish to allow use of your version of this file only under the terms   }
  37. { of the LGPL License and not to allow others to use your version of this file }
  38. { under the MPL, indicate your decision by deleting  the provisions above and  }
  39. { replace  them with the notice and other provisions required by the LGPL      }
  40. { License.  If you do not delete the provisions above, a recipient may use     }
  41. { your version of this file under either the MPL or the LGPL License.          }
  42. {                                                                              }
  43. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  44. {                                                                              }
  45. {******************************************************************************}
  46. unit DirectSound;
  47. interface
  48. uses
  49.   Windows, MMSystem, DXTypes;
  50. (*==========================================================================;
  51.  *
  52.  *  Copyright (c) Microsoft Corporation.  All rights reserved.
  53.  *
  54.  *  File:       dsound.h
  55.  *  Content:    DirectSound include file
  56.  *
  57.  **************************************************************************)
  58. {$I DirectX.inc}
  59. ////////////////////////////////////////////////////////////////////////
  60. // Global level dynamic loading support
  61. {$IFDEF DYNAMIC_LINK_ALL}
  62.   {$DEFINE DIRECTSOUND_DYNAMIC_LINK}
  63. {$ENDIF}
  64. {$IFDEF DYNAMIC_LINK_EXPLICIT_ALL}
  65.   {$DEFINE DIRECTSOUND_DYNAMIC_LINK_EXPLICIT}
  66. {$ENDIF}
  67. // Remove "dots" below to force some kind of dynamic linking
  68. {.$DEFINE DIRECTSOUND_DYNAMIC_LINK}
  69. {.$DEFINE DIRECTSOUND_DYNAMIC_LINK_EXPLICIT}
  70. ////////////////////////////////////////////////////////////////////////
  71. // Assume for what DirectSound version we will compile headers
  72. {$IFDEF DIRECTX7}
  73.   {$DEFINE DIRECTSOUND_VERSION_7}
  74. {$ENDIF}
  75. {$IFDEF DIRECTX8}
  76.   {$DEFINE DIRECTSOUND_VERSION_8}
  77. {$ENDIF}
  78. {$IFDEF DIRECTX9}
  79.   {$DEFINE DIRECTSOUND_VERSION_9}
  80. {$ENDIF}
  81. {$IFNDEF DIRECTSOUND_VERSION_9}
  82.   {$IFNDEF DIRECTSOUND_VERSION_8}
  83.     {$IFNDEF DIRECTSOUND_VERSION_7}
  84. // Compiling for DirectSound9 by default
  85.        {$DEFINE DIRECTSOUND_VERSION_9}
  86.     {$ENDIF}
  87.   {$ENDIF}
  88. {$ENDIF}
  89. ////////////////////////////////////////////////////////////////////////
  90. // Emit conditionals to C++Builder compiler
  91. {$IFDEF DIRECTSOUND_VERSION_7}
  92.   {$HPPEMIT '#define DIRECTSOUND_VERSION         0x0700'}
  93. {$ENDIF}
  94. {$IFDEF DIRECTSOUND_VERSION_8}
  95.   {$HPPEMIT '#define DIRECTSOUND_VERSION         0x0800'}
  96. {$ENDIF}
  97. {$IFDEF DIRECTSOUND_VERSION_9}
  98.   {$HPPEMIT '#define DIRECTSOUND_VERSION         0x0900'}
  99. {$ENDIF}
  100. {$NOINCLUDE DXTypes}
  101. (*$HPPEMIT '#include "dsound.h"' *)
  102. ////////////////////////////////////////////////////////////////////////
  103. // Define symbols for '<=' comparision
  104. {$IFDEF DIRECTSOUND_VERSION_9}
  105.   {$DEFINE DIRECTSOUND_VERSION_8}
  106. {$ENDIF}
  107. {$IFDEF DIRECTSOUND_VERSION_8}
  108.   {$DEFINE DIRECTSOUND_VERSION_7}
  109. {$ENDIF}
  110. { Type definitions shared with Direct3D }
  111. type
  112.   D3DVALUE = DXTypes.D3DVALUE;
  113.   {$EXTERNALSYM D3DVALUE}
  114.   TD3DValue = DXTypes.TD3DValue;
  115.   {$NODEFINE TD3DValue}
  116.   PD3DValue = DXTypes.PD3DValue;
  117.   {$NODEFINE PD3DValue}
  118.   D3DCOLOR = DXTypes.D3DCOLOR;
  119.   {$EXTERNALSYM D3DCOLOR}
  120.   TD3DColor = DXTypes.TD3DColor;
  121.   {$NODEFINE TD3DColor}
  122.   _D3DVECTOR = DXTypes._D3DVECTOR;
  123.   {$EXTERNALSYM _D3DVECTOR}
  124.   D3DVECTOR = DXTypes.D3DVECTOR;
  125.   {$EXTERNALSYM D3DVECTOR}
  126.   TD3DVector = DXTypes.TD3DVector;
  127.   {$NODEFINE TD3DVector}
  128.   PD3DVector = DXTypes.PD3DVector;
  129.   {$NODEFINE PD3DVector}
  130. {$HPPEMIT ''}
  131. {$HPPEMIT '#ifndef DX_SHARED_DEFINES_BCB'}
  132. {$HPPEMIT ''}
  133. {$HPPEMIT 'typedef D3DVALUE TD3DValue;'}
  134. {$HPPEMIT 'typedef D3DVALUE *PD3DValue;'}
  135. {$HPPEMIT ''}
  136. {$HPPEMIT '#ifndef D3DCOLOR_DEFINED_BCB'}
  137. {$HPPEMIT 'typedef D3DCOLOR TD3DColor;'}
  138. {$HPPEMIT '#define D3DCOLOR_DEFINED_BCB'}
  139. {$HPPEMIT '#endif'}
  140. {$HPPEMIT ''}
  141. {$HPPEMIT '#ifndef D3DVECTOR_DEFINED_BCB'}
  142. {$HPPEMIT 'typedef _D3DVECTOR TD3DVector;'}
  143. {$HPPEMIT 'typedef _D3DVECTOR *PD3DVector;'}
  144. {$HPPEMIT '#define D3DVECTOR_DEFINED_BCB'}
  145. {$HPPEMIT '#endif'}
  146. {$HPPEMIT ''}
  147. {$HPPEMIT '#define DX_SHARED_DEFINES_BCB'}
  148. {$HPPEMIT '#endif // DX_SHARED_DEFINES_BCB'}
  149. {$HPPEMIT ''}
  150. const
  151.   _FACDS = $878;                { DirectSound's facility code }
  152.   {$EXTERNALSYM _FACDS}
  153. // #define MAKE_DSHRESULT(code)  MAKE_HRESULT(1, _FACDS, code)
  154. function MAKE_DSHRESULT(Code: DWord): DWord;
  155. {$EXTERNALSYM MAKE_DSHRESULT}
  156. const
  157.   MAKE_DSHRESULT_R     = (1 shl 31) or (_FACDS shl 16);
  158. const
  159.   // DirectSound Component GUID {47D4D946-62E8-11CF-93BC-444553540000}
  160.   CLSID_DirectSound: TGUID = '{47d4d946-62e8-11cf-93bc-444553540000}';
  161.   {$EXTERNALSYM CLSID_DirectSound}
  162.   // DirectSound 8.0 Component GUID {3901CC3F-84B5-4FA4-BA35-AA8172B8A09B}
  163.   CLSID_DirectSound8: TGUID = '{3901cc3f-84b5-4fa4-ba35-aa8172b8a09b}';
  164.   {$EXTERNALSYM CLSID_DirectSound8}
  165.   // DirectSound Capture Component GUID {B0210780-89CD-11D0-AF08-00A0C925CD16}
  166.   CLSID_DirectSoundCapture: TGUID = '{b0210780-89cd-11d0-af08-00a0c925cd16}';
  167.   {$EXTERNALSYM CLSID_DirectSoundCapture}
  168.   // DirectSound 8.0 Capture Component GUID {E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1}
  169.   CLSID_DirectSoundCapture8: TGUID = '{e4bcac13-7f99-4908-9a8e-74e3bf24b6e1}';
  170.   {$EXTERNALSYM CLSID_DirectSoundCapture8}
  171.   // DirectSound Full Duplex Component GUID {FEA4300C-7959-4147-B26A-2377B9E7A91D}
  172.   CLSID_DirectSoundFullDuplex: TGUID = '{fea4300c-7959-4147-b26a-2377b9e7a91d}';
  173.   {$EXTERNALSYM CLSID_DirectSoundFullDuplex}
  174.   // DirectSound default playback device GUID {DEF00000-9C6D-47ED-AAF1-4DDA8F2B5C03}
  175.   DSDEVID_DefaultPlayback: TGUID = '{def00000-9c6d-47ed-aaf1-4dda8f2b5c03}';
  176.   {$EXTERNALSYM DSDEVID_DefaultPlayback}
  177.   // DirectSound default capture device GUID {DEF00001-9C6D-47ED-AAF1-4DDA8F2B5C03}
  178.   DSDEVID_DefaultCapture: TGUID = '{def00001-9c6d-47ed-aaf1-4dda8f2b5c03}';
  179.   {$EXTERNALSYM DSDEVID_DefaultCapture}
  180.   // DirectSound default device for voice playback {DEF00002-9C6D-47ED-AAF1-4DDA8F2B5C03}
  181.   DSDEVID_DefaultVoicePlayback: TGUID = '{def00002-9c6d-47ed-aaf1-4dda8f2b5c03}';
  182.   {$EXTERNALSYM DSDEVID_DefaultVoicePlayback}
  183.   // DirectSound default device for voice capture {DEF00003-9C6D-47ED-AAF1-4DDA8F2B5C03}
  184.   DSDEVID_DefaultVoiceCapture: TGUID = '{def00003-9c6d-47ed-aaf1-4dda8f2b5c03}';
  185.   {$EXTERNALSYM DSDEVID_DefaultVoiceCapture}
  186. //
  187. // Structures
  188. //
  189. type
  190.   PDSCaps = ^TDSCaps;
  191.   _DSCAPS = packed record
  192.     dwSize                         : DWORD;
  193.     dwFlags                        : DWORD;
  194.     dwMinSecondarySampleRate       : DWORD;
  195.     dwMaxSecondarySampleRate       : DWORD;
  196.     dwPrimaryBuffers               : DWORD;
  197.     dwMaxHwMixingAllBuffers        : DWORD;
  198.     dwMaxHwMixingStaticBuffers     : DWORD;
  199.     dwMaxHwMixingStreamingBuffers  : DWORD;
  200.     dwFreeHwMixingAllBuffers       : DWORD;
  201.     dwFreeHwMixingStaticBuffers    : DWORD;
  202.     dwFreeHwMixingStreamingBuffers : DWORD;
  203.     dwMaxHw3DAllBuffers            : DWORD;
  204.     dwMaxHw3DStaticBuffers         : DWORD;
  205.     dwMaxHw3DStreamingBuffers      : DWORD;
  206.     dwFreeHw3DAllBuffers           : DWORD;
  207.     dwFreeHw3DStaticBuffers        : DWORD;
  208.     dwFreeHw3DStreamingBuffers     : DWORD;
  209.     dwTotalHwMemBytes              : DWORD;
  210.     dwFreeHwMemBytes               : DWORD;
  211.     dwMaxContigFreeHwMemBytes      : DWORD;
  212.     dwUnlockTransferRateHwBuffers  : DWORD;
  213.     dwPlayCpuOverheadSwBuffers     : DWORD;
  214.     dwReserved1                    : DWORD;
  215.     dwReserved2                    : DWORD;
  216.   end;
  217.   {$EXTERNALSYM _DSCAPS}
  218.   DSCAPS = _DSCAPS;
  219.   {$EXTERNALSYM DSCAPS}
  220.   TDSCaps = _DSCAPS;
  221.   PDSBcaps = ^TDSBcaps;
  222.   _DSBCAPS = packed record
  223.     dwSize                : DWORD;
  224.     dwFlags               : DWORD;
  225.     dwBufferBytes         : DWORD;
  226.     dwUnlockTransferRate  : DWORD;
  227.     dwPlayCpuOverhead     : DWORD;
  228.   end;
  229.   {$EXTERNALSYM _DSBCAPS}
  230.   DSBCAPS = _DSBCAPS;
  231.   {$EXTERNALSYM DSBCAPS}
  232.   TDSBcaps = _DSBCAPS;
  233. {$IFDEF DIRECTSOUND_VERSION_8} // #if DIRECTSOUND_VERSION >= 0x0800
  234.   {$IFDEF WIN64}
  235.   DWORD_PTR = Int64;
  236.   {$ELSE}
  237.   DWORD_PTR = DWORD;
  238.   {$ENDIF}
  239.   {$NODEFINE DWORD_PTR}
  240.   PDSEffectDesc = ^TDSEffectDesc;
  241.   _DSEFFECTDESC = packed record
  242.       dwSize        : DWORD;
  243.       dwFlags       : DWORD;
  244.       guidDSFXClass : TGUID;
  245.       dwReserved1   : DWORD_PTR;
  246.       dwReserved2   : DWORD_PTR;
  247.   end;
  248.   {$EXTERNALSYM _DSEFFECTDESC}
  249.   DSEFFECTDESC = _DSEFFECTDESC;
  250.   {$EXTERNALSYM DSEFFECTDESC}
  251.   TDSEffectDesc = _DSEFFECTDESC;
  252. const
  253.   DSFX_LOCHARDWARE    = $00000001;
  254.   {$EXTERNALSYM DSFX_LOCHARDWARE}
  255.   DSFX_LOCSOFTWARE    = $00000002;
  256.   {$EXTERNALSYM DSFX_LOCSOFTWARE}
  257.   DSFXR_PRESENT          = 0;
  258.   {$EXTERNALSYM DSFXR_PRESENT}
  259.   DSFXR_LOCHARDWARE      = 1;
  260.   {$EXTERNALSYM DSFXR_LOCHARDWARE}
  261.   DSFXR_LOCSOFTWARE      = 2;
  262.   {$EXTERNALSYM DSFXR_LOCSOFTWARE}
  263.   DSFXR_UNALLOCATED      = 3;
  264.   {$EXTERNALSYM DSFXR_UNALLOCATED}
  265.   DSFXR_FAILED           = 4;
  266.   {$EXTERNALSYM DSFXR_FAILED}
  267.   DSFXR_UNKNOWN          = 5;
  268.   {$EXTERNALSYM DSFXR_UNKNOWN}
  269.   DSFXR_SENDLOOP         = 6;
  270.   {$EXTERNALSYM DSFXR_SENDLOOP}
  271. type
  272.   PDSCEffectDesc = ^TDSCEffectDesc;
  273.   _DSCEFFECTDESC = packed record
  274.     dwSize: DWORD;
  275.     dwFlags: DWORD;
  276.     guidDSCFXClass: TGUID;
  277.     guidDSCFXInstance: TGUID;
  278.     dwReserved1: DWORD;
  279.     dwReserved2: DWORD;
  280.   end;
  281.   {$EXTERNALSYM _DSCEFFECTDESC}
  282.   DSCEFFECTDESC = _DSCEFFECTDESC;
  283.   {$EXTERNALSYM DSCEFFECTDESC}
  284.   TDSCEffectDesc = _DSCEFFECTDESC;
  285. const
  286.   DSCFX_LOCHARDWARE   = $00000001;
  287.   {$EXTERNALSYM DSCFX_LOCHARDWARE}
  288.   DSCFX_LOCSOFTWARE   = $00000002;
  289.   {$EXTERNALSYM DSCFX_LOCSOFTWARE}
  290.   DSCFXR_LOCHARDWARE  = $00000010;
  291.   {$EXTERNALSYM DSCFXR_LOCHARDWARE}
  292.   DSCFXR_LOCSOFTWARE  = $00000020;
  293.   {$EXTERNALSYM DSCFXR_LOCSOFTWARE}
  294. {$ENDIF} // DIRECTSOUND_VERSION >= 0x0800
  295. type
  296.   PDSBufferDesc = ^TDSBufferDesc;
  297.   _DSBUFFERDESC = packed record
  298.     dwSize: DWORD;
  299.     dwFlags: DWORD;
  300.     dwBufferBytes: DWORD;
  301.     dwReserved: DWORD;
  302.     lpwfxFormat: PWaveFormatEx;
  303. {$IFDEF DIRECTSOUND_VERSION_7} // #if DIRECTSOUND_VERSION >= 0x0700
  304.     guid3DAlgorithm: TGUID;
  305. {$ENDIF} // DIRECTSOUND_VERSION >= 0x0700
  306.   end;
  307.   {$EXTERNALSYM _DSBUFFERDESC}
  308.   DSBUFFERDESC = _DSBUFFERDESC;
  309.   {$EXTERNALSYM DSBUFFERDESC}
  310.   TDSBufferDesc = _DSBUFFERDESC;
  311. // Older version of this structure:
  312.   PDSBufferDesc1 = ^TDSBufferDesc1;
  313.   _DSBUFFERDESC1 = packed record
  314.     dwSize: DWORD;
  315.     dwFlags: DWORD;
  316.     dwBufferBytes: DWORD;
  317.     dwReserved: DWORD;
  318.     lpwfxFormat: PWaveFormatEx;
  319.   end;
  320.   {$EXTERNALSYM _DSBUFFERDESC1}
  321.   DSBUFFERDESC1 = _DSBUFFERDESC1;
  322.   {$EXTERNALSYM DSBUFFERDESC1}
  323.   TDSBufferDesc1 = _DSBUFFERDESC1;
  324.   PDS3DBuffer = ^TDS3DBuffer;
  325.   _DS3DBUFFER = packed record
  326.     dwSize: DWORD;
  327.     vPosition: TD3DVector;
  328.     vVelocity: TD3DVector;
  329.     dwInsideConeAngle: DWORD;
  330.     dwOutsideConeAngle: DWORD;
  331.     vConeOrientation: TD3DVector;
  332.     lConeOutsideVolume: Longint;
  333.     flMinDistance: TD3DValue;
  334.     flMaxDistance: TD3DValue;
  335.     dwMode: DWORD;
  336.   end;
  337.   {$EXTERNALSYM _DS3DBUFFER}
  338.   DS3DBUFFER = _DS3DBUFFER;
  339.   {$EXTERNALSYM DS3DBUFFER}
  340.   TDS3DBuffer = _DS3DBUFFER;
  341.   PDS3DListener = ^TDS3DListener;
  342.   _DS3DLISTENER = packed record
  343.     dwSize: DWORD;
  344.     vPosition: TD3DVector;
  345.     vVelocity: TD3DVector;
  346.     vOrientFront: TD3DVector;
  347.     vOrientTop: TD3DVector;
  348.     flDistanceFactor: TD3DValue;
  349.     flRolloffFactor: TD3DValue;
  350.     flDopplerFactor: TD3DValue;
  351.   end;
  352.   {$EXTERNALSYM _DS3DLISTENER}
  353.   DS3DLISTENER = _DS3DLISTENER;
  354.   {$EXTERNALSYM DS3DLISTENER}
  355.   TDS3DListener = _DS3DLISTENER;
  356.   PDSCcaps = ^TDSCcaps;
  357.   _DSCCAPS = packed record
  358.     dwSize: DWORD;
  359.     dwFlags: DWORD;
  360.     dwFormats: DWORD;
  361.     dwChannels: DWORD;
  362.   end;
  363.   {$EXTERNALSYM _DSCCAPS}
  364.   DSCCAPS = _DSCCAPS;
  365.   {$EXTERNALSYM DSCCAPS}
  366.   TDSCcaps = _DSCCAPS;
  367.   PDSCBufferDesc1 = ^TDSCBufferDesc1;
  368.   _DSCBUFFERDESC1 = packed record
  369.     dwSize: DWORD;
  370.     dwFlags: DWORD;
  371.     dwBufferBytes: DWORD;
  372.     dwReserved: DWORD;
  373.     lpwfxFormat: PWaveFormatEx;
  374.   end;
  375.   {$EXTERNALSYM _DSCBUFFERDESC1}
  376.   DSCBUFFERDESC1 = _DSCBUFFERDESC1;
  377.   {$EXTERNALSYM DSCBUFFERDESC1}
  378.   TDSCBufferDesc1 = _DSCBUFFERDESC1;
  379.   PDSCBufferDesc = ^TDSCBufferDesc;
  380.   _DSCBUFFERDESC = packed record
  381.     dwSize: DWORD;
  382.     dwFlags: DWORD;
  383.     dwBufferBytes: DWORD;
  384.     dwReserved: DWORD;
  385.     lpwfxFormat: PWaveFormatEx;
  386. {$IFDEF DIRECTSOUND_VERSION_8} // #if DIRECTSOUND_VERSION >= 0x0800
  387.     dwFXCount: DWORD;
  388.     lpDSCFXDesc: PDSCEffectDesc;
  389. {$ENDIF} // DIRECTSOUND_VERSION >= 0x0800
  390.   end;
  391.   {$EXTERNALSYM _DSCBUFFERDESC}
  392.   DSCBUFFERDESC = _DSCBUFFERDESC;
  393.   {$EXTERNALSYM DSCBUFFERDESC}
  394.   TDSCBufferDesc = _DSCBUFFERDESC;
  395.   PDSCBCaps = ^TDSCBCaps;
  396.   _DSCBCAPS = packed record
  397.     dwSize: DWORD;
  398.     dwFlags: DWORD;
  399.     dwBufferBytes: DWORD;
  400.     dwReserved: DWORD;
  401.   end;
  402.   {$EXTERNALSYM _DSCBCAPS}
  403.   DSCBCAPS = _DSCBCAPS;
  404.   {$EXTERNALSYM DSCBCAPS}
  405.   TDSCBCaps = _DSCBCAPS;
  406.   PDSBPositionNotify = ^TDSBPositionNotify;
  407.   _DSBPOSITIONNOTIFY = packed record
  408.     dwOffset: DWORD;
  409.     hEventNotify: THandle;
  410.   end;
  411.   {$EXTERNALSYM _DSBPOSITIONNOTIFY}
  412.   DSBPOSITIONNOTIFY = _DSBPOSITIONNOTIFY;
  413.   {$EXTERNALSYM DSBPOSITIONNOTIFY}
  414.   TDSBPositionNotify = _DSBPOSITIONNOTIFY;
  415. type
  416.   PReferenceTime = ^TReferenceTime;
  417.   REFERENCE_TIME = LONGLONG;
  418.   {$EXTERNALSYM REFERENCE_TIME}
  419.   TReferenceTime = REFERENCE_TIME;
  420. type
  421.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IReferenceClock);'}
  422.   {$EXTERNALSYM IReferenceClock}
  423.   IReferenceClock = interface(IUnknown)
  424.     ['{56a86897-0ad4-11ce-b03a-0020af0ba770}']
  425.     // IReferenceClock methods
  426.     function GetTime(out pTime: TReferenceTime): HResult; stdcall;
  427.     function AdviseTime(rtBaseTime, rtStreamTime: TReferenceTime; hEvent: THandle; out pdwAdviseCookie: DWORD): HResult; stdcall;
  428.     function AdvisePeriodic(const rtStartTime, rtPeriodTime: TReferenceTime; hSemaphore: THandle; out pdwAdviseCookie: DWORD): HResult; stdcall;
  429.     function Unadvise(dwAdviseCookie: DWORD): HResult; stdcall;
  430.   end;
  431.   IID_IReferenceClock = IReferenceClock;
  432.   {$EXTERNALSYM IID_IReferenceClock}
  433.   IDirectSoundBuffer = interface;
  434.   //
  435.   // IDirectSound
  436.   //
  437.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSound);'}
  438.   {$EXTERNALSYM IDirectSound}
  439.   IDirectSound = interface(IUnknown)
  440.     ['{279AFA83-4981-11CE-A521-0020AF0BE560}']
  441.     // IDirectSound methods
  442.     function CreateSoundBuffer(const pcDSBufferDesc: TDSBufferDesc; out ppDSBuffer: IDirectSoundBuffer; pUnkOuter: IUnknown): HResult; stdcall;
  443.     function GetCaps(out pDSCaps: TDSCaps): HResult; stdcall;
  444.     function DuplicateSoundBuffer(pDSBufferOriginal: IDirectSoundBuffer; out ppDSBufferDuplicate: IDirectSoundBuffer): HResult; stdcall;
  445.     function SetCooperativeLevel(hwnd: HWND; dwLevel: DWORD): HResult; stdcall;
  446.     function Compact: HResult; stdcall;
  447.     function GetSpeakerConfig(out pdwSpeakerConfig: DWORD): HResult; stdcall;
  448.     function SetSpeakerConfig(dwSpeakerConfig: DWORD): HResult; stdcall;
  449.     function Initialize(pcGuidDevice: PGUID): HResult; stdcall;
  450.   end;
  451.   IID_IDirectSound = IDirectSound;
  452.   {$EXTERNALSYM IID_IDirectSound}
  453. {$IFDEF DIRECTSOUND_VERSION_8} // #if DIRECTSOUND_VERSION >= 0x0800
  454.   //
  455.   // IDirectSound8
  456.   //
  457.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSound8);'}
  458.   {$EXTERNALSYM IDirectSound8}
  459.   IDirectSound8 = interface(IDirectSound)
  460.     ['{C50A7E93-F395-4834-9EF6-7FA99DE50966}']
  461.     // IDirectSound8 methods
  462.     function VerifyCertification(pdwCertified: PDWORD): HResult; stdcall;
  463.   end;
  464.   IID_IDirectSound8 = IDirectSound8;
  465.   {$EXTERNALSYM IID_IDirectSound8}
  466. {$ENDIF} // DIRECTSOUND_VERSION >= 0x0800
  467.   //
  468.   // IDirectSoundBuffer
  469.   //
  470.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundBuffer);'}
  471.   {$EXTERNALSYM IDirectSoundBuffer}
  472.   IDirectSoundBuffer = interface(IUnknown)
  473.     ['{279AFA85-4981-11CE-A521-0020AF0BE560}']
  474.     // IDirectSoundBuffer methods
  475.     function GetCaps(var pDSBufferCaps: TDSBcaps): HResult; stdcall;
  476.     function GetCurrentPosition(pdwCurrentPlayCursor, pdwCurrentWriteCursor: PDWORD): HResult; stdcall;
  477.     function GetFormat(pwfxFormat: PWaveFormatEx; dwSizeAllocated: DWORD; pdwSizeWritten: PDWORD): HResult; stdcall;
  478.     function GetVolume(out plVolume: Longint): HResult; stdcall;
  479.     function GetPan(out plPan: Longint): HResult; stdcall;
  480.     function GetFrequency(out pdwFrequency: DWORD): HResult; stdcall;
  481.     function GetStatus(out pdwStatus: DWORD): HResult; stdcall;
  482.     function Initialize(pDirectSound: IDirectSound; const pcDSBufferDesc: TDSBufferDesc): HResult; stdcall;
  483.     function Lock(dwOffset, dwBytes: DWORD; out ppvAudioPtr1: Pointer; out pdwAudioBytes1: DWORD;
  484.       out ppvAudioPtr2: Pointer; out pdwAudioBytes2: DWORD; dwFlags: DWORD): HResult; stdcall;
  485.     function Play(dwReserved1, dwPriority, dwFlags: DWORD): HResult; stdcall;
  486.     function SetCurrentPosition(dwNewPosition: DWORD): HResult; stdcall;
  487.     function SetFormat(pcfxFormat: PWaveFormatEx): HResult; stdcall;
  488.     function SetVolume(lVolume: Longint): HResult; stdcall;
  489.     function SetPan(lPan: Longint): HResult; stdcall;
  490.     function SetFrequency(dwFrequency: DWORD): HResult; stdcall;
  491.     function Stop: HResult; stdcall;
  492.     function Unlock(pvAudioPtr1: Pointer; dwAudioBytes1: DWORD; pvAudioPtr2: Pointer; dwAudioBytes2: DWORD): HResult; stdcall;
  493.     function Restore: HResult; stdcall;
  494.   end;
  495.   IID_IDirectSoundBuffer = IDirectSoundBuffer;
  496.   {$EXTERNALSYM IID_IDirectSoundBuffer}
  497. {$IFDEF DIRECTSOUND_VERSION_8} // #if DIRECTSOUND_VERSION >= 0x0800
  498.   //
  499.   // IDirectSoundBuffer8
  500.   //
  501.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundBuffer8);'}
  502.   {$EXTERNALSYM IDirectSoundBuffer8}
  503.   IDirectSoundBuffer8 = interface(IDirectSoundBuffer)
  504.     ['{6825a449-7524-4d82-920f-50e36ab3ab1e}']
  505.     // IDirectSoundBuffer8 methods
  506.     function SetFX(dwEffectsCount: DWORD; pDSFXDesc: PDSEffectDesc; pdwResultCodes: PDWORD): HResult; stdcall;
  507.     function AcquireResources(dwFlags, dwEffectsCount, pdwResultCodes: PDWORD): HResult; stdcall;
  508.     function GetObjectInPath(const rguidObject: TGUID; dwIndex: DWORD; const rguidInterface: TGUID; out ppObject{IUnknown}): HResult; stdcall;
  509.   end;
  510.   IID_IDirectSoundBuffer8 = IDirectSoundBuffer8;
  511.   {$EXTERNALSYM IID_IDirectSoundBuffer8}
  512. const
  513.   // Special GUID meaning "select all objects" for use in GetObjectInPath()
  514.   GUID_All_Objects: TGUID = '{aa114de5-c262-4169-a1c8-23d698cc73b5}';
  515.   {$EXTERNALSYM GUID_All_Objects}
  516. type
  517. {$ENDIF} // DIRECTSOUND_VERSION >= 0x0800
  518.   //
  519.   // IDirectSound3DListener
  520.   //
  521.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSound3DListener);'}
  522.   {$EXTERNALSYM IDirectSound3DListener}
  523.   IDirectSound3DListener = interface(IUnknown)
  524.     ['{279AFA84-4981-11CE-A521-0020AF0BE560}']
  525.     // IDirectSound3DListener methods
  526.     function GetAllParameters(var pListener: TDS3DListener): HResult; stdcall;
  527.     function GetDistanceFactor(out pflDistanceFactor: TD3DValue): HResult; stdcall;
  528.     function GetDopplerFactor(out pflDopplerFactor: TD3DValue): HResult; stdcall;
  529.     function GetOrientation(out pvOrientFront, pvOrientTop: TD3DVector): HResult; stdcall;
  530.     function GetPosition(out pvPosition: TD3DVector): HResult; stdcall;
  531.     function GetRolloffFactor(out pflRolloffFactor: TD3DValue): HResult; stdcall;
  532.     function GetVelocity(out pvVelocity: TD3DVector): HResult; stdcall;
  533.     function SetAllParameters(const pcListener: TDS3DListener; dwApply: DWORD): HResult; stdcall;
  534.     function SetDistanceFactor(flDistanceFactor: TD3DValue; dwApply: DWORD): HResult; stdcall;
  535.     function SetDopplerFactor(flDopplerFactor: TD3DValue; dwApply: DWORD): HResult; stdcall;
  536.     function SetOrientation(xFront, yFront, zFront: TD3DValue; xTop, yTop, zTop: TD3DValue; dwApply: DWORD): HResult; stdcall;
  537.     function SetPosition(x, y, z: TD3DValue; dwApply: DWORD): HResult; stdcall;
  538.     function SetRolloffFactor(flRolloffFactor: TD3DValue; dwApply: DWORD): HResult; stdcall;
  539.     function SetVelocity(x, y, z: TD3DValue; dwApply: DWORD): HResult; stdcall;
  540.     function CommitDeferredSettings: HResult; stdcall;
  541.   end;
  542.   IID_IDirectSound3DListener = IDirectSound3DListener;
  543.   {$EXTERNALSYM IID_IDirectSound3DListener}
  544.   //
  545.   // IDirectSound3DBuffer
  546.   //
  547.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSound3DBuffer);'}
  548.   {$EXTERNALSYM IDirectSound3DBuffer}
  549.   IDirectSound3DBuffer = interface(IUnknown)
  550.     ['{279AFA86-4981-11CE-A521-0020AF0BE560}']
  551.     // IDirectSound3DBuffer methods
  552.     function GetAllParameters(var pDs3dBuffer: TDS3DBuffer): HResult; stdcall;
  553.     function GetConeAngles(var pdwInsideConeAngle, pdwOutsideConeAngle: DWORD): HResult; stdcall;
  554.     function GetConeOrientation(out pvOrientation: TD3DVector): HResult; stdcall;
  555.     function GetConeOutsideVolume(out plConeOutsideVolume: Longint): HResult; stdcall;
  556.     function GetMaxDistance(out pflMaxDistance: TD3DValue): HResult; stdcall;
  557.     function GetMinDistance(out pflMinDistance: TD3DValue): HResult; stdcall;
  558.     function GetMode(out pdwMode: DWORD): HResult; stdcall;
  559.     function GetPosition(out pvPosition: TD3DVector): HResult; stdcall;
  560.     function GetVelocity(out pvVelocity: TD3DVector): HResult; stdcall;
  561.     function SetAllParameters(const pcDs3dBuffer: TDS3DBuffer; dwApply: DWORD): HResult; stdcall;
  562.     function SetConeAngles(dwInsideConeAngle, dwOutsideConeAngle: DWORD; dwApply: DWORD): HResult; stdcall;
  563.     function SetConeOrientation(x, y, z: TD3DValue; dwApply: DWORD): HResult; stdcall;
  564.     function SetConeOutsideVolume(lConeOutsideVolume: Longint; dwApply: DWORD): HResult; stdcall;
  565.     function SetMaxDistance(flMaxDistance: TD3DValue; dwApply: DWORD): HResult; stdcall;
  566.     function SetMinDistance(flMinDistance: TD3DValue; dwApply: DWORD): HResult; stdcall;
  567.     function SetMode(dwMode: DWORD; dwApply: DWORD): HResult; stdcall;
  568.     function SetPosition(x, y, z: TD3DValue; dwApply: DWORD): HResult; stdcall;
  569.     function SetVelocity(x, y, z: TD3DValue; dwApply: DWORD): HResult; stdcall;
  570.   end;
  571.   IID_IDirectSound3DBuffer = IDirectSound3DBuffer;
  572.   {$EXTERNALSYM IID_IDirectSound3DBuffer}
  573.   IDirectSoundCaptureBuffer = interface;
  574.   //
  575.   // IDirectSoundCapture
  576.   //
  577.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundCapture);'}
  578.   {$EXTERNALSYM IDirectSoundCapture}
  579.   IDirectSoundCapture = interface(IUnknown)
  580.     ['{b0210781-89cd-11d0-af08-00a0c925cd16}']
  581.     // IDirectSoundCapture methods
  582.     function CreateCaptureBuffer(const pcDSCBufferDesc: TDSCBufferDesc; out ppDSCBuffer: IDirectSoundCaptureBuffer; pUnkOuter: IUnknown): HResult; stdcall;
  583.     function GetCaps(var pDSCCaps: TDSCcaps): HResult; stdcall;
  584.     function Initialize(pcGuidDevice: PGUID): HResult; stdcall;
  585.   end;
  586.   IID_IDirectSoundCapture = IDirectSoundCapture;
  587.   {$EXTERNALSYM IID_IDirectSoundCapture}
  588.   //
  589.   // IDirectSoundCaptureBuffer
  590.   //
  591.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundCaptureBuffer);'}
  592.   {$EXTERNALSYM IDirectSoundCaptureBuffer}
  593.   IDirectSoundCaptureBuffer = interface(IUnknown)
  594.     ['{b0210782-89cd-11d0-af08-00a0c925cd16}']
  595.     // IDirectSoundCaptureBuffer methods
  596.     function GetCaps(var pDSCBCaps: TDSCBCaps): HResult; stdcall;
  597.     function GetCurrentPosition(pdwCapturePosition, pdwReadPosition: PDWORD): HResult; stdcall;
  598.     function GetFormat(pwfxFormat: PWaveFormatEx; dwSizeAllocated: DWORD; pdwSizeWritten: PDWORD): HResult; stdcall;
  599.     function GetStatus(pdwStatus: PDWORD): HResult; stdcall;
  600.     function Initialize(pDirectSoundCapture: IDirectSoundCapture; const pcDSCBufferDesc: TDSCBufferDesc): HResult; stdcall;
  601.     function Lock(dwOffset, dwBytes: DWORD; out ppvAudioPtr1: Pointer; out pdwAudioBytes1: DWORD; out ppvAudioPtr2: Pointer; out pdwAudioBytes2: DWORD; dwFlags: DWORD): HResult; stdcall;
  602.     function Start(dwFlags: DWORD): HResult; stdcall;
  603.     function Stop: HResult; stdcall;
  604.     function Unlock(pvAudioPtr1: Pointer; dwAudioBytes1: DWORD; pvAudioPtr2: Pointer; dwAudioBytes2: DWORD): HResult; stdcall;
  605.   end;
  606.   IID_IDirectSoundCaptureBuffer = IDirectSoundCaptureBuffer;
  607.   {$EXTERNALSYM IID_IDirectSoundCaptureBuffer}
  608. {$IFDEF DIRECTSOUND_VERSION_8} // #if DIRECTSOUND_VERSION >= 0x0800
  609.   //
  610.   // IDirectSoundCaptureBuffer8
  611.   //
  612.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundCaptureBuffer8);'}
  613.   {$EXTERNALSYM IDirectSoundCaptureBuffer8}
  614.   IDirectSoundCaptureBuffer8 = interface(IDirectSoundCaptureBuffer)
  615.     ['{00990df4-0dbb-4872-833e-6d303e80aeb6}']
  616.     // IDirectSoundCaptureBuffer8 methods
  617.     function GetObjectInPath(const rguidObject: TGUID; dwIndex: DWORD; const rguidInterface: TGUID; out ppObject{IUnknown}): HResult; stdcall;
  618.     function GetFXStatus(dwFXCount: DWORD; pdwFXStatus: PDWORD): HResult; stdcall;
  619.   end;
  620.   IID_IDirectSoundCaptureBuffer8 = IDirectSoundCaptureBuffer8;
  621.   {$EXTERNALSYM IID_IDirectSoundCaptureBuffer8}
  622. {$ENDIF} // DIRECTSOUND_VERSION >= 0x0800
  623.   //
  624.   // IDirectSoundNotify
  625.   //
  626.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundNotify);'}
  627.   {$EXTERNALSYM IDirectSoundNotify}
  628.   IDirectSoundNotify = interface(IUnknown)
  629.     ['{b0210783-89cd-11d0-af08-00a0c925cd16}']
  630.     // IDirectSoundNotify methods
  631.     function SetNotificationPositions(dwPositionNotifies: DWORD; pcPositionNotifies: PDSBPositionNotify): HResult; stdcall;
  632.   end;
  633.   IID_IDirectSoundNotify = IDirectSoundNotify;
  634.   {$EXTERNALSYM IID_IDirectSoundNotify}
  635.   //
  636.   // IKsPropertySet
  637.   //
  638. const
  639.   KSPROPERTY_SUPPORT_GET  = $00000001;
  640.   {$EXTERNALSYM KSPROPERTY_SUPPORT_GET}
  641.   KSPROPERTY_SUPPORT_SET  = $00000002;
  642.   {$EXTERNALSYM KSPROPERTY_SUPPORT_SET}
  643. type
  644.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IKsPropertySet);'}
  645.   {$EXTERNALSYM IKsPropertySet}
  646.   IKsPropertySet = interface(IUnknown)
  647.     ['{31efac30-515c-11d0-a9aa-00aa0061be93}']
  648.     // IKsPropertySet methods
  649.     function Get(const rguidPropSet: TGUID; ulId: ULONG; pInstanceData: Pointer; ulInstanceLength: ULONG; pPropertyData: Pointer; ulDataLength: ULONG; out pulBytesReturned: ULONG): HResult; stdcall;
  650.     function _Set(const rguidPropSet: TGUID; ulId: ULONG; pInstanceData: Pointer; ulInstanceLength: ULONG; pPropertyData: Pointer; ulDataLength: ULONG): HResult; stdcall;
  651.     function QuerySupport(rguidPropSet: TGUID; ulId: ULONG; out pulTypeSupport: ULONG): HResult; stdcall;
  652.   end;
  653.   IID_IKsPropertySet = IKsPropertySet;
  654.   {$EXTERNALSYM IID_IKsPropertySet}
  655. {$IFDEF DIRECTSOUND_VERSION_8} // #if DIRECTSOUND_VERSION >= 0x0800
  656.   //
  657.   // IDirectSoundFXGargle
  658.   //
  659.   PDSFXGargle = ^TDSFXGargle;
  660.   _DSFXGargle = packed record
  661.     dwRateHz: DWORD;               // Rate of modulation in hz
  662.     dwWaveShape: DWORD;            // DSFXGARGLE_WAVE_xxx
  663.   end;
  664.   {$EXTERNALSYM _DSFXGargle}
  665.   DSFXGargle = _DSFXGargle;
  666.   {$EXTERNALSYM DSFXGargle}
  667.   TDSFXGargle = _DSFXGargle;
  668. const
  669.   DSFXGARGLE_WAVE_TRIANGLE        = 0;
  670.   {$EXTERNALSYM DSFXGARGLE_WAVE_TRIANGLE}
  671.   DSFXGARGLE_WAVE_SQUARE          = 1;
  672.   {$EXTERNALSYM DSFXGARGLE_WAVE_SQUARE}
  673.   DSFXGARGLE_RATEHZ_MIN           = 1;
  674.   {$EXTERNALSYM DSFXGARGLE_RATEHZ_MIN}
  675.   DSFXGARGLE_RATEHZ_MAX           = 1000;
  676.   {$EXTERNALSYM DSFXGARGLE_RATEHZ_MAX}
  677. type
  678.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundFXGargle);'}
  679.   {$EXTERNALSYM IDirectSoundFXGargle}
  680.   IDirectSoundFXGargle = interface(IUnknown)
  681.     ['{d616f352-d622-11ce-aac5-0020af0b99a3}']
  682.     // IDirectSoundFXGargle methods
  683.     function SetAllParameters(const pcDsFxGargle: TDSFXGargle): HResult; stdcall;
  684.     function GetAllParameters(out pDsFxGargle: TDSFXGargle): HResult; stdcall;
  685.   end;
  686.   IID_IDirectSoundFXGargle = IDirectSoundFXGargle;
  687.   {$EXTERNALSYM IID_IDirectSoundFXGargle}
  688.   //
  689.   // IDirectSoundFXChorus
  690.   //
  691.   PDSFXChorus = ^TDSFXChorus;
  692.   _DSFXChorus = packed record
  693.     fWetDryMix: Single;
  694.     fDepth: Single;
  695.     fFeedback: Single;
  696.     fFrequency: Single;
  697.     lWaveform: Longint;          // LFO shape; DSFXCHORUS_WAVE_xxx
  698.     fDelay: Single;
  699.     lPhase: Longint;
  700.   end;
  701.   {$EXTERNALSYM _DSFXChorus}
  702.   DSFXChorus = _DSFXChorus;
  703.   {$EXTERNALSYM DSFXChorus}
  704.   TDSFXChorus = _DSFXChorus;
  705. const
  706.   DSFXCHORUS_WAVE_TRIANGLE        = 0;
  707.   {$EXTERNALSYM DSFXCHORUS_WAVE_TRIANGLE}
  708.   DSFXCHORUS_WAVE_SIN             = 1;
  709.   {$EXTERNALSYM DSFXCHORUS_WAVE_SIN}
  710.   DSFXCHORUS_WETDRYMIX_MIN        = 0.0;
  711.   {$EXTERNALSYM DSFXCHORUS_WETDRYMIX_MIN}
  712.   DSFXCHORUS_WETDRYMIX_MAX        = 100.0;
  713.   {$EXTERNALSYM DSFXCHORUS_WETDRYMIX_MAX}
  714.   DSFXCHORUS_DEPTH_MIN            = 0.0;
  715.   {$EXTERNALSYM DSFXCHORUS_DEPTH_MIN}
  716.   DSFXCHORUS_DEPTH_MAX            = 100.0;
  717.   {$EXTERNALSYM DSFXCHORUS_DEPTH_MAX}
  718.   DSFXCHORUS_FEEDBACK_MIN         = -99.0;
  719.   {$EXTERNALSYM DSFXCHORUS_FEEDBACK_MIN}
  720.   DSFXCHORUS_FEEDBACK_MAX         = 99.0;
  721.   {$EXTERNALSYM DSFXCHORUS_FEEDBACK_MAX}
  722.   DSFXCHORUS_FREQUENCY_MIN        = 0.0;
  723.   {$EXTERNALSYM DSFXCHORUS_FREQUENCY_MIN}
  724.   DSFXCHORUS_FREQUENCY_MAX        = 10.0;
  725.   {$EXTERNALSYM DSFXCHORUS_FREQUENCY_MAX}
  726.   DSFXCHORUS_DELAY_MIN            = 0.0;
  727.   {$EXTERNALSYM DSFXCHORUS_DELAY_MIN}
  728.   DSFXCHORUS_DELAY_MAX            = 20.0;
  729.   {$EXTERNALSYM DSFXCHORUS_DELAY_MAX}
  730.   DSFXCHORUS_PHASE_MIN            = 0;
  731.   {$EXTERNALSYM DSFXCHORUS_PHASE_MIN}
  732.   DSFXCHORUS_PHASE_MAX            = 4;
  733.   {$EXTERNALSYM DSFXCHORUS_PHASE_MAX}
  734.   DSFXCHORUS_PHASE_NEG_180        = 0;
  735.   {$EXTERNALSYM DSFXCHORUS_PHASE_NEG_180}
  736.   DSFXCHORUS_PHASE_NEG_90         = 1;
  737.   {$EXTERNALSYM DSFXCHORUS_PHASE_NEG_90}
  738.   DSFXCHORUS_PHASE_ZERO           = 2;
  739.   {$EXTERNALSYM DSFXCHORUS_PHASE_ZERO}
  740.   DSFXCHORUS_PHASE_90             = 3;
  741.   {$EXTERNALSYM DSFXCHORUS_PHASE_90}
  742.   DSFXCHORUS_PHASE_180            = 4;
  743.   {$EXTERNALSYM DSFXCHORUS_PHASE_180}
  744. type
  745.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundFXChorus);'}
  746.   {$EXTERNALSYM IDirectSoundFXChorus}
  747.   IDirectSoundFXChorus = interface(IUnknown)
  748.     ['{880842e3-145f-43e6-a934-a71806e50547}']
  749.     // IDirectSoundFXChorus methods
  750.     function SetAllParameters(const pcDsFxChorus: TDSFXChorus): HResult; stdcall;
  751.     function GetAllParameters(out pDsFxChorus: TDSFXChorus): HResult; stdcall;
  752.   end;
  753.   IID_IDirectSoundFXChorus = IDirectSoundFXChorus;
  754.   {$EXTERNALSYM IID_IDirectSoundFXChorus}
  755.   //
  756.   // IDirectSoundFXFlanger
  757.   //
  758.   PDSFXFlanger = ^TDSFXFlanger;
  759.   _DSFXFlanger = packed record
  760.     fWetDryMix: Single;
  761.     fDepth: Single;
  762.     fFeedback: Single;
  763.     fFrequency: Single;
  764.     lWaveform: Longint;
  765.     fDelay: Single;
  766.     lPhase: Longint;
  767.   end;
  768.   {$EXTERNALSYM _DSFXFlanger}
  769.   DSFXFlanger = _DSFXFlanger;
  770.   {$EXTERNALSYM DSFXFlanger}
  771.   TDSFXFlanger = _DSFXFlanger;
  772. const
  773.   DSFXFLANGER_WAVE_TRIANGLE       = 0;
  774.   {$EXTERNALSYM DSFXFLANGER_WAVE_TRIANGLE}
  775.   DSFXFLANGER_WAVE_SIN            = 1;
  776.   {$EXTERNALSYM DSFXFLANGER_WAVE_SIN}
  777.   DSFXFLANGER_WETDRYMIX_MIN       = 0.0;
  778.   {$EXTERNALSYM DSFXFLANGER_WETDRYMIX_MIN}
  779.   DSFXFLANGER_WETDRYMIX_MAX       = 100.0;
  780.   {$EXTERNALSYM DSFXFLANGER_WETDRYMIX_MAX}
  781.   DSFXFLANGER_FREQUENCY_MIN       = 0.0;
  782.   {$EXTERNALSYM DSFXFLANGER_FREQUENCY_MIN}
  783.   DSFXFLANGER_FREQUENCY_MAX       = 10.0;
  784.   {$EXTERNALSYM DSFXFLANGER_FREQUENCY_MAX}
  785.   DSFXFLANGER_DEPTH_MIN           = 0.0;
  786.   {$EXTERNALSYM DSFXFLANGER_DEPTH_MIN}
  787.   DSFXFLANGER_DEPTH_MAX           = 100.0;
  788.   {$EXTERNALSYM DSFXFLANGER_DEPTH_MAX}
  789.   DSFXFLANGER_PHASE_MIN           = 0;
  790.   {$EXTERNALSYM DSFXFLANGER_PHASE_MIN}
  791.   DSFXFLANGER_PHASE_MAX           = 4;
  792.   {$EXTERNALSYM DSFXFLANGER_PHASE_MAX}
  793.   DSFXFLANGER_FEEDBACK_MIN        = -99.0;
  794.   {$EXTERNALSYM DSFXFLANGER_FEEDBACK_MIN}
  795.   DSFXFLANGER_FEEDBACK_MAX        = 99.0;
  796.   {$EXTERNALSYM DSFXFLANGER_FEEDBACK_MAX}
  797.   DSFXFLANGER_DELAY_MIN           = 0.0;
  798.   {$EXTERNALSYM DSFXFLANGER_DELAY_MIN}
  799.   DSFXFLANGER_DELAY_MAX           = 4.0;
  800.   {$EXTERNALSYM DSFXFLANGER_DELAY_MAX}
  801.   DSFXFLANGER_PHASE_NEG_180       = 0;
  802.   {$EXTERNALSYM DSFXFLANGER_PHASE_NEG_180}
  803.   DSFXFLANGER_PHASE_NEG_90        = 1;
  804.   {$EXTERNALSYM DSFXFLANGER_PHASE_NEG_90}
  805.   DSFXFLANGER_PHASE_ZERO          = 2;
  806.   {$EXTERNALSYM DSFXFLANGER_PHASE_ZERO}
  807.   DSFXFLANGER_PHASE_90            = 3;
  808.   {$EXTERNALSYM DSFXFLANGER_PHASE_90}
  809.   DSFXFLANGER_PHASE_180           = 4;
  810.   {$EXTERNALSYM DSFXFLANGER_PHASE_180}
  811. type
  812.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundFXFlanger);'}
  813.   {$EXTERNALSYM IDirectSoundFXFlanger}
  814.   IDirectSoundFXFlanger = interface(IUnknown)
  815.     ['{903e9878-2c92-4072-9b2c-ea68f5396783}']
  816.     // IDirectSoundFXFlanger methods
  817.     function SetAllParameters(const pcDsFxFlanger: TDSFXFlanger): HResult; stdcall;
  818.     function GetAllParameters(out pDsFxFlanger: TDSFXFlanger): HResult; stdcall;
  819.   end;
  820.   IID_IDirectSoundFXFlanger = IDirectSoundFXFlanger;
  821.   {$EXTERNALSYM IID_IDirectSoundFXFlanger}
  822.   //
  823.   // IDirectSoundFXEcho
  824.   //
  825.   PDSFXEcho = ^TDSFXEcho;
  826.   _DSFXEcho = packed record
  827.     fWetDryMix: Single;
  828.     fFeedback: Single;
  829.     fLeftDelay: Single;
  830.     fRightDelay: Single;
  831.     lPanDelay: Longint;
  832.   end;
  833.   {$EXTERNALSYM _DSFXEcho}
  834.   DSFXEcho = _DSFXEcho;
  835.   {$EXTERNALSYM DSFXEcho}
  836.   TDSFXEcho = _DSFXEcho;
  837. const
  838.   DSFXECHO_WETDRYMIX_MIN      = 0.0;
  839.   {$EXTERNALSYM DSFXECHO_WETDRYMIX_MIN}
  840.   DSFXECHO_WETDRYMIX_MAX      = 100.0;
  841.   {$EXTERNALSYM DSFXECHO_WETDRYMIX_MAX}
  842.   DSFXECHO_FEEDBACK_MIN       = 0.0;
  843.   {$EXTERNALSYM DSFXECHO_FEEDBACK_MIN}
  844.   DSFXECHO_FEEDBACK_MAX       = 100.0;
  845.   {$EXTERNALSYM DSFXECHO_FEEDBACK_MAX}
  846.   DSFXECHO_LEFTDELAY_MIN      = 1.0;
  847.   {$EXTERNALSYM DSFXECHO_LEFTDELAY_MIN}
  848.   DSFXECHO_LEFTDELAY_MAX      = 2000.0;
  849.   {$EXTERNALSYM DSFXECHO_LEFTDELAY_MAX}
  850.   DSFXECHO_RIGHTDELAY_MIN     = 1.0;
  851.   {$EXTERNALSYM DSFXECHO_RIGHTDELAY_MIN}
  852.   DSFXECHO_RIGHTDELAY_MAX     = 2000.0;
  853.   {$EXTERNALSYM DSFXECHO_RIGHTDELAY_MAX}
  854.   DSFXECHO_PANDELAY_MIN       = 0;
  855.   {$EXTERNALSYM DSFXECHO_PANDELAY_MIN}
  856.   DSFXECHO_PANDELAY_MAX       = 1;
  857.   {$EXTERNALSYM DSFXECHO_PANDELAY_MAX}
  858. type
  859.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundFXEcho);'}
  860.   {$EXTERNALSYM IDirectSoundFXEcho}
  861.   IDirectSoundFXEcho = interface(IUnknown)
  862.     ['{8bd28edf-50db-4e92-a2bd-445488d1ed42}']
  863.     // IDirectSoundFXEcho methods
  864.     function SetAllParameters(const pcDsFxEcho: TDSFXEcho): HResult; stdcall;
  865.     function GetAllParameters(out pDsFxEcho: TDSFXEcho): HResult; stdcall;
  866.   end;
  867.   IID_IDirectSoundFXEcho = IDirectSoundFXEcho;
  868.   {$EXTERNALSYM IID_IDirectSoundFXEcho}
  869.   //
  870.   // IDirectSoundFXDistortion
  871.   //
  872.   PDSFXDistortion = ^TDSFXDistortion;
  873.   _DSFXDistortion = packed record
  874.     fGain: Single;
  875.     fEdge: Single;
  876.     fPostEQCenterFrequency: Single;
  877.     fPostEQBandwidth: Single;
  878.     fPreLowpassCutoff: Single;
  879.   end;
  880.   {$EXTERNALSYM _DSFXDistortion}
  881.   DSFXDistortion = _DSFXDistortion;
  882.   {$EXTERNALSYM DSFXDistortion}
  883.   TDSFXDistortion = _DSFXDistortion;
  884. const
  885.   DSFXDISTORTION_GAIN_MIN                     = -60.0;
  886.   {$EXTERNALSYM DSFXDISTORTION_GAIN_MIN}
  887.   DSFXDISTORTION_GAIN_MAX                     = 0.0;
  888.   {$EXTERNALSYM DSFXDISTORTION_GAIN_MAX}
  889.   DSFXDISTORTION_EDGE_MIN                     = 0.0;
  890.   {$EXTERNALSYM DSFXDISTORTION_EDGE_MIN}
  891.   DSFXDISTORTION_EDGE_MAX                     = 100.0;
  892.   {$EXTERNALSYM DSFXDISTORTION_EDGE_MAX}
  893.   DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN    = 100.0;
  894.   {$EXTERNALSYM DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN}
  895.   DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX    = 8000.0;
  896.   {$EXTERNALSYM DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX}
  897.   DSFXDISTORTION_POSTEQBANDWIDTH_MIN          = 100.0;
  898.   {$EXTERNALSYM DSFXDISTORTION_POSTEQBANDWIDTH_MIN}
  899.   DSFXDISTORTION_POSTEQBANDWIDTH_MAX          = 8000.0;
  900.   {$EXTERNALSYM DSFXDISTORTION_POSTEQBANDWIDTH_MAX}
  901.   DSFXDISTORTION_PRELOWPASSCUTOFF_MIN         = 100.0;
  902.   {$EXTERNALSYM DSFXDISTORTION_PRELOWPASSCUTOFF_MIN}
  903.   DSFXDISTORTION_PRELOWPASSCUTOFF_MAX         = 8000.0;
  904.   {$EXTERNALSYM DSFXDISTORTION_PRELOWPASSCUTOFF_MAX}
  905. type
  906.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundFXDistortion);'}
  907.   {$EXTERNALSYM IDirectSoundFXDistortion}
  908.   IDirectSoundFXDistortion = interface(IUnknown)
  909.     ['{8ecf4326-455f-4d8b-bda9-8d5d3e9e3e0b}']
  910.     // IDirectSoundFXDistortion methods
  911.     function SetAllParameters(const pcDsFxDistortion: TDSFXDistortion): HResult; stdcall;
  912.     function GetAllParameters(out pDsFxDistortion: TDSFXDistortion): HResult; stdcall;
  913.   end;
  914.   IID_IDirectSoundFXDistortion = IDirectSoundFXDistortion;
  915.   {$EXTERNALSYM IID_IDirectSoundFXDistortion}
  916.   //
  917.   // IDirectSoundFXCompressor
  918.   //
  919.   PDSFXCompressor = ^TDSFXCompressor;
  920.   _DSFXCompressor = packed record
  921.     fGain: Single;
  922.     fAttack: Single;
  923.     fRelease: Single;
  924.     fThreshold: Single;
  925.     fRatio: Single;
  926.     fPredelay: Single;
  927.   end;
  928.   {$EXTERNALSYM _DSFXCompressor}
  929.   DSFXCompressor = _DSFXCompressor;
  930.   {$EXTERNALSYM DSFXCompressor}
  931.   TDSFXCompressor = _DSFXCompressor;
  932. const
  933.   DSFXCOMPRESSOR_GAIN_MIN             = -60.0;
  934.   {$EXTERNALSYM DSFXCOMPRESSOR_GAIN_MIN}
  935.   DSFXCOMPRESSOR_GAIN_MAX             = 60.0;
  936.   {$EXTERNALSYM DSFXCOMPRESSOR_GAIN_MAX}
  937.   DSFXCOMPRESSOR_ATTACK_MIN           = 0.01;
  938.   {$EXTERNALSYM DSFXCOMPRESSOR_ATTACK_MIN}
  939.   DSFXCOMPRESSOR_ATTACK_MAX           = 500.0;
  940.   {$EXTERNALSYM DSFXCOMPRESSOR_ATTACK_MAX}
  941.   DSFXCOMPRESSOR_RELEASE_MIN          = 50.0;
  942.   {$EXTERNALSYM DSFXCOMPRESSOR_RELEASE_MIN}
  943.   DSFXCOMPRESSOR_RELEASE_MAX          = 3000.0;
  944.   {$EXTERNALSYM DSFXCOMPRESSOR_RELEASE_MAX}
  945.   DSFXCOMPRESSOR_THRESHOLD_MIN        = -60.0;
  946.   {$EXTERNALSYM DSFXCOMPRESSOR_THRESHOLD_MIN}
  947.   DSFXCOMPRESSOR_THRESHOLD_MAX        = 0.0;
  948.   {$EXTERNALSYM DSFXCOMPRESSOR_THRESHOLD_MAX}
  949.   DSFXCOMPRESSOR_RATIO_MIN            = 1.0;
  950.   {$EXTERNALSYM DSFXCOMPRESSOR_RATIO_MIN}
  951.   DSFXCOMPRESSOR_RATIO_MAX            = 100.0;
  952.   {$EXTERNALSYM DSFXCOMPRESSOR_RATIO_MAX}
  953.   DSFXCOMPRESSOR_PREDELAY_MIN         = 0.0;
  954.   {$EXTERNALSYM DSFXCOMPRESSOR_PREDELAY_MIN}
  955.   DSFXCOMPRESSOR_PREDELAY_MAX         = 4.0;
  956.   {$EXTERNALSYM DSFXCOMPRESSOR_PREDELAY_MAX}
  957. type
  958.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundFXCompressor);'}
  959.   {$EXTERNALSYM IDirectSoundFXCompressor}
  960.   IDirectSoundFXCompressor = interface(IUnknown)
  961.     ['{4bbd1154-62f6-4e2c-a15c-d3b6c417f7a0}']
  962.     // IDirectSoundFXCompressor methods
  963.     function SetAllParameters(const pcDsFxCompressor: TDSFXCompressor): HResult; stdcall;
  964.     function GetAllParameters(out pDsFxCompressor: TDSFXCompressor): HResult; stdcall;
  965.   end;
  966.   IID_IDirectSoundFXCompressor = IDirectSoundFXCompressor;
  967.   {$EXTERNALSYM IID_IDirectSoundFXCompressor}
  968.   //
  969.   // IDirectSoundFXParamEq
  970.   //
  971.   PDSFXParamEq = ^TDSFXParamEq;
  972.   _DSFXParamEq = packed record
  973.     fCenter: Single;
  974.     fBandwidth: Single;
  975.     fGain: Single;
  976.   end;
  977.   {$EXTERNALSYM _DSFXParamEq}
  978.   DSFXParamEq = _DSFXParamEq;
  979.   {$EXTERNALSYM DSFXParamEq}
  980.   TDSFXParamEq = _DSFXParamEq;
  981. const
  982.   DSFXPARAMEQ_CENTER_MIN      = 80.0;
  983.   {$EXTERNALSYM DSFXPARAMEQ_CENTER_MIN}
  984.   DSFXPARAMEQ_CENTER_MAX      = 16000.0;
  985.   {$EXTERNALSYM DSFXPARAMEQ_CENTER_MAX}
  986.   DSFXPARAMEQ_BANDWIDTH_MIN   = 1.0;
  987.   {$EXTERNALSYM DSFXPARAMEQ_BANDWIDTH_MIN}
  988.   DSFXPARAMEQ_BANDWIDTH_MAX   = 36.0;
  989.   {$EXTERNALSYM DSFXPARAMEQ_BANDWIDTH_MAX}
  990.   DSFXPARAMEQ_GAIN_MIN        = -15.0;
  991.   {$EXTERNALSYM DSFXPARAMEQ_GAIN_MIN}
  992.   DSFXPARAMEQ_GAIN_MAX        = 15.0;
  993.   {$EXTERNALSYM DSFXPARAMEQ_GAIN_MAX}
  994. type
  995.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundFXParamEq);'}
  996.   {$EXTERNALSYM IDirectSoundFXParamEq}
  997.   IDirectSoundFXParamEq = interface(IUnknown)
  998.     ['{c03ca9fe-fe90-4204-8078-82334cd177da}']
  999.     // IDirectSoundFXParamEq methods
  1000.     function SetAllParameters(const pcDsFxParamEq: TDSFXParamEq): HResult; stdcall;
  1001.     function GetAllParameters(out pDsFxParamEq: TDSFXParamEq): HResult; stdcall;
  1002.   end;
  1003.   IID_IDirectSoundFXParamEq = IDirectSoundFXParamEq;
  1004.   {$EXTERNALSYM IID_IDirectSoundFXParamEq}
  1005.   //
  1006.   // IDirectSoundFXI3DL2Reverb
  1007.   //
  1008.   PDSFXI3DL2Reverb = ^TDSFXI3DL2Reverb;
  1009.   _DSFXI3DL2Reverb = packed record
  1010.     lRoom: Longint;                  // [-10000, 0]      default: -1000 mB
  1011.     lRoomHF: Longint;                // [-10000, 0]      default: 0 mB
  1012.     flRoomRolloffFactor: Single;     // [0.0, 10.0]      default: 0.0
  1013.     flDecayTime: Single;             // [0.1, 20.0]      default: 1.49s
  1014.     flDecayHFRatio: Single;          // [0.1, 2.0]       default: 0.83
  1015.     lReflections: Longint;           // [-10000, 1000]   default: -2602 mB
  1016.     flReflectionsDelay: Single;      // [0.0, 0.3]       default: 0.007 s
  1017.     lReverb: Longint;                // [-10000, 2000]   default: 200 mB
  1018.     flReverbDelay: Single;           // [0.0, 0.1]       default: 0.011 s
  1019.     flDiffusion: Single;             // [0.0, 100.0]     default: 100.0 %
  1020.     flDensity: Single;               // [0.0, 100.0]     default: 100.0 %
  1021.     flHFReference: Single;           // [20.0, 20000.0]  default: 5000.0 Hz
  1022.   end;
  1023.   {$EXTERNALSYM _DSFXI3DL2Reverb}
  1024.   DSFXI3DL2Reverb = _DSFXI3DL2Reverb;
  1025.   {$EXTERNALSYM DSFXI3DL2Reverb}
  1026.   TDSFXI3DL2Reverb = _DSFXI3DL2Reverb;
  1027. const
  1028.   DSFX_I3DL2REVERB_ROOM_MIN                   = (-10000);
  1029.   {$EXTERNALSYM DSFX_I3DL2REVERB_ROOM_MIN}
  1030.   DSFX_I3DL2REVERB_ROOM_MAX                   = 0;
  1031.   {$EXTERNALSYM DSFX_I3DL2REVERB_ROOM_MAX}
  1032.   DSFX_I3DL2REVERB_ROOM_DEFAULT               = (-1000);
  1033.   {$EXTERNALSYM DSFX_I3DL2REVERB_ROOM_DEFAULT}
  1034.   DSFX_I3DL2REVERB_ROOMHF_MIN                 = (-10000);
  1035.   {$EXTERNALSYM DSFX_I3DL2REVERB_ROOMHF_MIN}
  1036.   DSFX_I3DL2REVERB_ROOMHF_MAX                 = 0;
  1037.   {$EXTERNALSYM DSFX_I3DL2REVERB_ROOMHF_MAX}
  1038.   DSFX_I3DL2REVERB_ROOMHF_DEFAULT             = (-100);
  1039.   {$EXTERNALSYM DSFX_I3DL2REVERB_ROOMHF_DEFAULT}
  1040.   DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN      = 0.0;
  1041.   {$EXTERNALSYM DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN}
  1042.   DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX      = 10.0;
  1043.   {$EXTERNALSYM DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX}
  1044.   DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT  = 0.0;
  1045.   {$EXTERNALSYM DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT}
  1046.   DSFX_I3DL2REVERB_DECAYTIME_MIN              = 0.1;
  1047.   {$EXTERNALSYM DSFX_I3DL2REVERB_DECAYTIME_MIN}
  1048.   DSFX_I3DL2REVERB_DECAYTIME_MAX              = 20.0;
  1049.   {$EXTERNALSYM DSFX_I3DL2REVERB_DECAYTIME_MAX}
  1050.   DSFX_I3DL2REVERB_DECAYTIME_DEFAULT          = 1.49;
  1051.   {$EXTERNALSYM DSFX_I3DL2REVERB_DECAYTIME_DEFAULT}
  1052.   DSFX_I3DL2REVERB_DECAYHFRATIO_MIN           = 0.1;
  1053.   {$EXTERNALSYM DSFX_I3DL2REVERB_DECAYHFRATIO_MIN}
  1054.   DSFX_I3DL2REVERB_DECAYHFRATIO_MAX           = 2.0;
  1055.   {$EXTERNALSYM DSFX_I3DL2REVERB_DECAYHFRATIO_MAX}
  1056.   DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT       = 0.83;
  1057.   {$EXTERNALSYM DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT}
  1058.   DSFX_I3DL2REVERB_REFLECTIONS_MIN            = (-10000);
  1059.   {$EXTERNALSYM DSFX_I3DL2REVERB_REFLECTIONS_MIN}
  1060.   DSFX_I3DL2REVERB_REFLECTIONS_MAX            = 1000;
  1061.   {$EXTERNALSYM DSFX_I3DL2REVERB_REFLECTIONS_MAX}
  1062.   DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT        = (-2602);
  1063.   {$EXTERNALSYM DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT}
  1064.   DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN       = 0.0;
  1065.   {$EXTERNALSYM DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN}
  1066.   DSFX_I3DL2REVERB_REFLECTIONSDELAY_MAX       = 0.3;
  1067.   {$EXTERNALSYM DSFX_I3DL2REVERB_REFLECTIONSDELAY_MAX}
  1068.   DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT   = 0.007;
  1069.   {$EXTERNALSYM DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT}
  1070.   DSFX_I3DL2REVERB_REVERB_MIN                 = (-10000);
  1071.   {$EXTERNALSYM DSFX_I3DL2REVERB_REVERB_MIN}
  1072.   DSFX_I3DL2REVERB_REVERB_MAX                 = 2000;
  1073.   {$EXTERNALSYM DSFX_I3DL2REVERB_REVERB_MAX}
  1074.   DSFX_I3DL2REVERB_REVERB_DEFAULT             = (200);
  1075.   {$EXTERNALSYM DSFX_I3DL2REVERB_REVERB_DEFAULT}
  1076.   DSFX_I3DL2REVERB_REVERBDELAY_MIN            = 0.0;
  1077.   {$EXTERNALSYM DSFX_I3DL2REVERB_REVERBDELAY_MIN}
  1078.   DSFX_I3DL2REVERB_REVERBDELAY_MAX            = 0.1;
  1079.   {$EXTERNALSYM DSFX_I3DL2REVERB_REVERBDELAY_MAX}
  1080.   DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT        = 0.011;
  1081.   {$EXTERNALSYM DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT}
  1082.   DSFX_I3DL2REVERB_DIFFUSION_MIN              = 0.0;
  1083.   {$EXTERNALSYM DSFX_I3DL2REVERB_DIFFUSION_MIN}
  1084.   DSFX_I3DL2REVERB_DIFFUSION_MAX              = 100.0;
  1085.   {$EXTERNALSYM DSFX_I3DL2REVERB_DIFFUSION_MAX}
  1086.   DSFX_I3DL2REVERB_DIFFUSION_DEFAULT          = 100.0;
  1087.   {$EXTERNALSYM DSFX_I3DL2REVERB_DIFFUSION_DEFAULT}
  1088.   DSFX_I3DL2REVERB_DENSITY_MIN                = 0.0;
  1089.   {$EXTERNALSYM DSFX_I3DL2REVERB_DENSITY_MIN}
  1090.   DSFX_I3DL2REVERB_DENSITY_MAX                = 100.0;
  1091.   {$EXTERNALSYM DSFX_I3DL2REVERB_DENSITY_MAX}
  1092.   DSFX_I3DL2REVERB_DENSITY_DEFAULT            = 100.0;
  1093.   {$EXTERNALSYM DSFX_I3DL2REVERB_DENSITY_DEFAULT}
  1094.   DSFX_I3DL2REVERB_HFREFERENCE_MIN            = 20.0;
  1095.   {$EXTERNALSYM DSFX_I3DL2REVERB_HFREFERENCE_MIN}
  1096.   DSFX_I3DL2REVERB_HFREFERENCE_MAX            = 20000.0;
  1097.   {$EXTERNALSYM DSFX_I3DL2REVERB_HFREFERENCE_MAX}
  1098.   DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT        = 5000.0;
  1099.   {$EXTERNALSYM DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT}
  1100.   DSFX_I3DL2REVERB_QUALITY_MIN                = 0;
  1101.   {$EXTERNALSYM DSFX_I3DL2REVERB_QUALITY_MIN}
  1102.   DSFX_I3DL2REVERB_QUALITY_MAX                = 3;
  1103.   {$EXTERNALSYM DSFX_I3DL2REVERB_QUALITY_MAX}
  1104.   DSFX_I3DL2REVERB_QUALITY_DEFAULT            = 2;
  1105.   {$EXTERNALSYM DSFX_I3DL2REVERB_QUALITY_DEFAULT}
  1106. type
  1107.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundFXI3DL2Reverb);'}
  1108.   {$EXTERNALSYM IDirectSoundFXI3DL2Reverb}
  1109.   IDirectSoundFXI3DL2Reverb = interface(IUnknown)
  1110.     ['{4b166a6a-0d66-43f3-80e3-ee6280dee1a4}']
  1111.     // IDirectSoundFXI3DL2Reverb methods
  1112.     function SetAllParameters(const pcDsFxI3DL2Reverb: TDSFXI3DL2Reverb): HResult; stdcall;
  1113.     function GetAllParameters(out pDsFxI3DL2Reverb: TDSFXI3DL2Reverb): HResult; stdcall;
  1114.     function SetPreset(dwPreset: DWORD): HResult; stdcall;
  1115.     function GetPreset(out pdwPreset: DWORD): HResult; stdcall;
  1116.     function SetQuality(lQuality: Longint): HResult; stdcall;
  1117.     function GetQuality(out plQuality: Longint): HResult; stdcall;
  1118.   end;
  1119.   IID_IDirectSoundFXI3DL2Reverb = IDirectSoundFXI3DL2Reverb;
  1120.   {$EXTERNALSYM IID_IDirectSoundFXI3DL2Reverb}
  1121.   //
  1122.   // IDirectSoundFXWavesReverb
  1123.   //
  1124.   PDSFXWavesReverb = ^TDSFXWavesReverb;
  1125.   _DSFXWavesReverb = packed record
  1126.     fInGain: Single;                // [-96.0,0.0]            default: 0.0 dB
  1127.     fReverbMix: Single;             // [-96.0,0.0]            default: 0.0 db
  1128.     fReverbTime: Single;            // [0.001,3000.0]         default: 1000.0 ms
  1129.     fHighFreqRTRatio: Single;       // [0.001,0.999]          default: 0.001
  1130.   end;
  1131.   {$EXTERNALSYM _DSFXWavesReverb}
  1132.   DSFXWavesReverb = _DSFXWavesReverb;
  1133.   {$EXTERNALSYM DSFXWavesReverb}
  1134.   TDSFXWavesReverb = _DSFXWavesReverb;
  1135. const
  1136.   DSFX_WAVESREVERB_INGAIN_MIN                 = -96.0;
  1137.   {$EXTERNALSYM DSFX_WAVESREVERB_INGAIN_MIN}
  1138.   DSFX_WAVESREVERB_INGAIN_MAX                 = 0.0;
  1139.   {$EXTERNALSYM DSFX_WAVESREVERB_INGAIN_MAX}
  1140.   DSFX_WAVESREVERB_INGAIN_DEFAULT             = 0.0;
  1141.   {$EXTERNALSYM DSFX_WAVESREVERB_INGAIN_DEFAULT}
  1142.   DSFX_WAVESREVERB_REVERBMIX_MIN              = -96.0;
  1143.   {$EXTERNALSYM DSFX_WAVESREVERB_REVERBMIX_MIN}
  1144.   DSFX_WAVESREVERB_REVERBMIX_MAX              = 0.0;
  1145.   {$EXTERNALSYM DSFX_WAVESREVERB_REVERBMIX_MAX}
  1146.   DSFX_WAVESREVERB_REVERBMIX_DEFAULT          = 0.0;
  1147.   {$EXTERNALSYM DSFX_WAVESREVERB_REVERBMIX_DEFAULT}
  1148.   DSFX_WAVESREVERB_REVERBTIME_MIN             = 0.001;
  1149.   {$EXTERNALSYM DSFX_WAVESREVERB_REVERBTIME_MIN}
  1150.   DSFX_WAVESREVERB_REVERBTIME_MAX             = 3000.0;
  1151.   {$EXTERNALSYM DSFX_WAVESREVERB_REVERBTIME_MAX}
  1152.   DSFX_WAVESREVERB_REVERBTIME_DEFAULT         = 1000.0;
  1153.   {$EXTERNALSYM DSFX_WAVESREVERB_REVERBTIME_DEFAULT}
  1154.   DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN        = 0.001;
  1155.   {$EXTERNALSYM DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN}
  1156.   DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX        = 0.999;
  1157.   {$EXTERNALSYM DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX}
  1158.   DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT    = 0.001;
  1159.   {$EXTERNALSYM DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT}
  1160. type
  1161.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundFXWavesReverb);'}
  1162.   {$EXTERNALSYM IDirectSoundFXWavesReverb}
  1163.   IDirectSoundFXWavesReverb = interface(IUnknown)
  1164.     ['{46858c3a-0dc6-45e3-b760-d4eef16cb325}']
  1165.     // IDirectSoundFXWavesReverb methods
  1166.     function SetAllParameters(const pcDsFxWavesReverb: TDSFXWavesReverb): HResult; stdcall;
  1167.     function GetAllParameters(out pDsFxWavesReverb: TDSFXWavesReverb): HResult; stdcall;
  1168.   end;
  1169.   IID_IDirectSoundFXWavesReverb = IDirectSoundFXWavesReverb;
  1170.   {$EXTERNALSYM IID_IDirectSoundFXWavesReverb}
  1171.   
  1172.   //
  1173.   // IDirectSoundCaptureFXAec
  1174.   //
  1175.   PDSCFXAec = ^TDSCFXAec;
  1176.   _DSCFXAec = packed record
  1177.     fEnable: BOOL;
  1178.     fNoiseFill: BOOL;
  1179.     dwMode: DWORD;
  1180.   end;
  1181.   {$EXTERNALSYM _DSCFXAec}
  1182.   DSCFXAec = _DSCFXAec;
  1183.   {$EXTERNALSYM DSCFXAec}
  1184.   TDSCFXAec = _DSCFXAec;
  1185. const
  1186.   // These match the AEC_MODE_* constants in the DDK's ksmedia.h file
  1187.   DSCFX_AEC_MODE_PASS_THROUGH                     = $0;
  1188.   {$EXTERNALSYM DSCFX_AEC_MODE_PASS_THROUGH}
  1189.   DSCFX_AEC_MODE_HALF_DUPLEX                      = $1;
  1190.   {$EXTERNALSYM DSCFX_AEC_MODE_HALF_DUPLEX}
  1191.   DSCFX_AEC_MODE_FULL_DUPLEX                      = $2;
  1192.   {$EXTERNALSYM DSCFX_AEC_MODE_FULL_DUPLEX}
  1193.   // These match the AEC_STATUS_* constants in ksmedia.h
  1194.   DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED          = $0;
  1195.   {$EXTERNALSYM DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED}
  1196.   DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED = $1;
  1197.   {$EXTERNALSYM DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED}
  1198.   DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED    = $2;
  1199.   {$EXTERNALSYM DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED}
  1200.   DSCFX_AEC_STATUS_CURRENTLY_CONVERGED            = $8;
  1201.   {$EXTERNALSYM DSCFX_AEC_STATUS_CURRENTLY_CONVERGED}
  1202. type
  1203.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundCaptureFXAec);'}
  1204.   {$EXTERNALSYM IDirectSoundCaptureFXAec}
  1205.   IDirectSoundCaptureFXAec = interface(IUnknown)
  1206.     ['{ad74143d-903d-4ab7-8066-28d363036d65}']
  1207.     // IDirectSoundCaptureFXAec methods
  1208.     function SetAllParameters(const pDscFxAec: TDSCFXAec): HResult; stdcall;
  1209.     function GetAllParameters(out pDscFxAec: TDSCFXAec): HResult; stdcall;
  1210.     function GetStatus(out pdwStatus: DWORD): HResult; stdcall;
  1211.     function Reset: HResult; stdcall;
  1212.   end;
  1213.   IID_IDirectSoundCaptureFXAec = IDirectSoundCaptureFXAec;
  1214.   {$EXTERNALSYM IID_IDirectSoundCaptureFXAec}
  1215.   //
  1216.   // IDirectSoundCaptureFXNoiseSuppress
  1217.   //
  1218.   PDSCFXNoiseSuppress = ^TDSCFXNoiseSuppress;
  1219.   _DSCFXNoiseSuppress = packed record
  1220.     fEnable:    BOOL;
  1221.   end;
  1222.   {$EXTERNALSYM _DSCFXNoiseSuppress}
  1223.   DSCFXNoiseSuppress = _DSCFXNoiseSuppress;
  1224.   {$EXTERNALSYM DSCFXNoiseSuppress}
  1225.   TDSCFXNoiseSuppress = _DSCFXNoiseSuppress;
  1226.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundCaptureFXNoiseSuppress);'}
  1227.   {$EXTERNALSYM IDirectSoundCaptureFXNoiseSuppress}
  1228.   IDirectSoundCaptureFXNoiseSuppress = interface(IUnknown)
  1229.     ['{ed311e41-fbae-4175-9625-cd0854f693ca}']
  1230.     // IDirectSoundCaptureFXNoiseSuppress methods
  1231.     function SetAllParameters(const pcDscFxNoiseSuppress: TDSCFXNoiseSuppress): HResult; stdcall;
  1232.     function GetAllParameters(out pDscFxNoiseSuppress: TDSCFXNoiseSuppress): HResult; stdcall;
  1233.     function Reset: HResult; stdcall;
  1234.   end;
  1235.   IID_IDirectSoundCaptureFXNoiseSuppress = IDirectSoundCaptureFXNoiseSuppress;
  1236.   {$EXTERNALSYM IID_IDirectSoundCaptureFXNoiseSuppress}
  1237.   //
  1238.   // IDirectSoundFullDuplex
  1239.   //
  1240.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectSoundFullDuplex);'}
  1241.   {$EXTERNALSYM IDirectSoundFullDuplex}
  1242.   IDirectSoundFullDuplex = interface(IUnknown)
  1243.     ['{edcb4c7a-daab-4216-a42e-6c50596ddc1d}']
  1244.     // IDirectSoundFullDuplex methods
  1245.     function Initialize(pCaptureGuid, pRenderGuid: PGUID;
  1246.       const lpDscBufferDesc: TDSCBufferDesc; const lpDsBufferDesc: TDSBufferDesc;
  1247.       hWnd: HWND; dwLevel: DWORD;
  1248.       out lplpDirectSoundCaptureBuffer8: IDirectSoundCaptureBuffer8;
  1249.       out lplpDirectSoundBuffer8: IDirectSoundBuffer8): HResult; stdcall;
  1250.   end;
  1251.   IID_IDirectSoundFullDuplex = IDirectSoundFullDuplex;
  1252.   {$EXTERNALSYM IID_IDirectSoundFullDuplex}
  1253. {$ENDIF} // DIRECTSOUND_VERSION >= 0x0800
  1254. //
  1255. // DirectSound 8.0 interfaces.
  1256. //
  1257. {$IFDEF DIRECTSOUND_VERSION_8} // #if DIRECTSOUND_VERSION >= 0x0800
  1258. // IDirectSound8, IDirectSoundBuffer8 and IDirectSoundCaptureBuffer8 are the
  1259. // only DirectSound 7.0 interfaces with changed functionality in version 8.0.
  1260. // The other level 8 interfaces as equivalent to their level 7 counterparts:
  1261. type
  1262.   IDirectSoundCapture8            = IDirectSoundCapture;
  1263.   {$EXTERNALSYM IDirectSoundCapture8}
  1264.   IDirectSound3DListener8         = IDirectSound3DListener;
  1265.   {$EXTERNALSYM IDirectSound3DListener8}
  1266.   IDirectSound3DBuffer8           = IDirectSound3DBuffer;
  1267.   {$EXTERNALSYM IDirectSound3DBuffer8}
  1268.   IDirectSoundNotify8             = IDirectSoundNotify;
  1269.   {$EXTERNALSYM IDirectSoundNotify8}
  1270.   IDirectSoundFXGargle8           = IDirectSoundFXGargle;
  1271.   {$EXTERNALSYM IDirectSoundFXGargle8}
  1272.   IDirectSoundFXChorus8           = IDirectSoundFXChorus;
  1273.   {$EXTERNALSYM IDirectSoundFXChorus8}
  1274.   IDirectSoundFXFlanger8          = IDirectSoundFXFlanger;
  1275.   {$EXTERNALSYM IDirectSoundFXFlanger8}
  1276.   IDirectSoundFXEcho8             = IDirectSoundFXEcho;
  1277.   {$EXTERNALSYM IDirectSoundFXEcho8}
  1278.   IDirectSoundFXDistortion8       = IDirectSoundFXDistortion;
  1279.   {$EXTERNALSYM IDirectSoundFXDistortion8}
  1280.   IDirectSoundFXCompressor8       = IDirectSoundFXCompressor;
  1281.   {$EXTERNALSYM IDirectSoundFXCompressor8}
  1282.   IDirectSoundFXParamEq8          = IDirectSoundFXParamEq;
  1283.   {$EXTERNALSYM IDirectSoundFXParamEq8}
  1284.   IDirectSoundFXWavesReverb8      = IDirectSoundFXWavesReverb;
  1285.   {$EXTERNALSYM IDirectSoundFXWavesReverb8}
  1286.   IDirectSoundFXI3DL2Reverb8      = IDirectSoundFXI3DL2Reverb;
  1287.   {$EXTERNALSYM IDirectSoundFXI3DL2Reverb8}
  1288.   IDirectSoundCaptureFXAec8       = IDirectSoundCaptureFXAec;
  1289.   {$EXTERNALSYM IDirectSoundCaptureFXAec8}
  1290.   IDirectSoundCaptureFXNoiseSuppress8 = IDirectSoundCaptureFXNoiseSuppress;
  1291.   {$EXTERNALSYM IDirectSoundCaptureFXNoiseSuppress8}
  1292.   IDirectSoundFullDuplex8         = IDirectSoundFullDuplex;
  1293.   {$EXTERNALSYM IDirectSoundFullDuplex8}
  1294.   //
  1295.   // IID definitions for the unchanged DirectSound 8.0 interfaces
  1296.   //
  1297.   IID_IDirectSoundCapture8            = IID_IDirectSoundCapture;
  1298.   {$EXTERNALSYM IID_IDirectSoundCapture8}
  1299.   IID_IDirectSound3DListener8         = IID_IDirectSound3DListener;
  1300.   {$EXTERNALSYM IID_IDirectSound3DListener8}
  1301.   IID_IDirectSound3DBuffer8           = IID_IDirectSound3DBuffer;
  1302.   {$EXTERNALSYM IID_IDirectSound3DBuffer8}
  1303.   IID_IDirectSoundNotify8             = IID_IDirectSoundNotify;
  1304.   {$EXTERNALSYM IID_IDirectSoundNotify8}
  1305.   IID_IDirectSoundFXGargle8           = IID_IDirectSoundFXGargle;
  1306.   {$EXTERNALSYM IID_IDirectSoundFXGargle8}
  1307.   IID_IDirectSoundFXChorus8           = IID_IDirectSoundFXChorus;
  1308.   {$EXTERNALSYM IID_IDirectSoundFXChorus8}
  1309.   IID_IDirectSoundFXFlanger8          = IID_IDirectSoundFXFlanger;
  1310.   {$EXTERNALSYM IID_IDirectSoundFXFlanger8}
  1311.   IID_IDirectSoundFXEcho8             = IID_IDirectSoundFXEcho;
  1312.   {$EXTERNALSYM IID_IDirectSoundFXEcho8}
  1313.   IID_IDirectSoundFXDistortion8       = IID_IDirectSoundFXDistortion;
  1314.   {$EXTERNALSYM IID_IDirectSoundFXDistortion8}
  1315.   IID_IDirectSoundFXCompressor8       = IID_IDirectSoundFXCompressor;
  1316.   {$EXTERNALSYM IID_IDirectSoundFXCompressor8}
  1317.   IID_IDirectSoundFXParamEq8          = IID_IDirectSoundFXParamEq;
  1318.   {$EXTERNALSYM IID_IDirectSoundFXParamEq8}
  1319.   IID_IDirectSoundFXWavesReverb8      = IID_IDirectSoundFXWavesReverb;
  1320.   {$EXTERNALSYM IID_IDirectSoundFXWavesReverb8}
  1321.   IID_IDirectSoundFXI3DL2Reverb8      = IID_IDirectSoundFXI3DL2Reverb;
  1322.   {$EXTERNALSYM IID_IDirectSoundFXI3DL2Reverb8}
  1323.   IID_IDirectSoundCaptureFXAec8       = IID_IDirectSoundCaptureFXAec;
  1324.   {$EXTERNALSYM IID_IDirectSoundCaptureFXAec8}
  1325.   IID_IDirectSoundCaptureFXNoiseSuppress8 = IID_IDirectSoundCaptureFXNoiseSuppress;
  1326.   {$EXTERNALSYM IID_IDirectSoundCaptureFXNoiseSuppress8}
  1327.   IID_IDirectSoundFullDuplex8         = IID_IDirectSoundFullDuplex;
  1328.   {$EXTERNALSYM IID_IDirectSoundFullDuplex8}
  1329. {$ENDIF} // DIRECTSOUND_VERSION >= 0x0800
  1330. const
  1331.   //
  1332.   // Return Codes
  1333.   //
  1334.   // The function completed successfully
  1335.   DS_OK                           = S_OK;
  1336.   {$EXTERNALSYM DS_OK}
  1337.   // The call succeeded, but we had to substitute the 3D algorithm
  1338.   DS_NO_VIRTUALIZATION            = (0 shl 31) or (_FACDS shl 16) or 10; // MAKE_HRESULT(0, _FACDS, 10)
  1339.   {$EXTERNALSYM DS_NO_VIRTUALIZATION}
  1340.   // The call failed because resources (such as a priority level)
  1341.   // were already being used by another caller
  1342.   DSERR_ALLOCATED                 = MAKE_DSHRESULT_R or 10; // MAKE_DSHRESULT(10)
  1343.   {$EXTERNALSYM DSERR_ALLOCATED}
  1344.   // The control (vol, pan, etc.) requested by the caller is not available
  1345.   DSERR_CONTROLUNAVAIL            = MAKE_DSHRESULT_R or 30; // MAKE_DSHRESULT(30)
  1346.   {$EXTERNALSYM DSERR_CONTROLUNAVAIL}
  1347.   // An invalid parameter was passed to the returning function
  1348.   DSERR_INVALIDPARAM              = E_INVALIDARG;
  1349.   {$EXTERNALSYM DSERR_INVALIDPARAM}
  1350.   // This call is not valid for the current state of this object
  1351.   DSERR_INVALIDCALL               = MAKE_DSHRESULT_R or 50; // MAKE_DSHRESULT(50)
  1352.   {$EXTERNALSYM DSERR_INVALIDCALL}
  1353.   // An undetermined error occurred inside the DirectSound subsystem
  1354.   DSERR_GENERIC                   = E_FAIL;
  1355.   {$EXTERNALSYM DSERR_GENERIC}
  1356.   // The caller does not have the priority level required for the function to
  1357.   // succeed
  1358.   DSERR_PRIOLEVELNEEDED           = MAKE_DSHRESULT_R or 70; // MAKE_DSHRESULT(70)
  1359.   {$EXTERNALSYM DSERR_PRIOLEVELNEEDED}
  1360.   // Not enough free memory is available to complete the operation
  1361.   DSERR_OUTOFMEMORY               = E_OUTOFMEMORY;
  1362.   {$EXTERNALSYM DSERR_OUTOFMEMORY}
  1363.   // The specified WAVE format is not supported
  1364.   DSERR_BADFORMAT                 = MAKE_DSHRESULT_R or 100; // MAKE_DSHRESULT(100)
  1365.   {$EXTERNALSYM DSERR_BADFORMAT}
  1366.   // The function called is not supported at this time
  1367.   DSERR_UNSUPPORTED               = E_NOTIMPL;
  1368.   {$EXTERNALSYM DSERR_UNSUPPORTED}
  1369.   // No sound driver is available for use
  1370.   DSERR_NODRIVER                  = MAKE_DSHRESULT_R or 120; // MAKE_DSHRESULT(120)
  1371.   {$EXTERNALSYM DSERR_NODRIVER}
  1372.   // This object is already initialized
  1373.   DSERR_ALREADYINITIALIZED        = MAKE_DSHRESULT_R or 130; // MAKE_DSHRESULT(130)
  1374.   {$EXTERNALSYM DSERR_ALREADYINITIALIZED}
  1375.   // This object does not support aggregation
  1376.   DSERR_NOAGGREGATION             = CLASS_E_NOAGGREGATION;
  1377.   {$EXTERNALSYM DSERR_NOAGGREGATION}
  1378.   // The buffer memory has been lost, and must be restored
  1379.   DSERR_BUFFERLOST                = MAKE_DSHRESULT_R or 150; // MAKE_DSHRESULT(150)
  1380.   {$EXTERNALSYM DSERR_BUFFERLOST}
  1381.   // Another app has a higher priority level, preventing this call from
  1382.   // succeeding
  1383.   DSERR_OTHERAPPHASPRIO           = MAKE_DSHRESULT_R or 160; // MAKE_DSHRESULT(160)
  1384.   {$EXTERNALSYM DSERR_OTHERAPPHASPRIO}
  1385.   // This object has not been initialized
  1386.   DSERR_UNINITIALIZED             = MAKE_DSHRESULT_R or 170; // MAKE_DSHRESULT(170)
  1387.   {$EXTERNALSYM DSERR_UNINITIALIZED}
  1388.   // The requested COM interface is not available
  1389.   DSERR_NOINTERFACE               = E_NOINTERFACE;
  1390.   {$EXTERNALSYM DSERR_NOINTERFACE}
  1391.   // Access is denied
  1392.   DSERR_ACCESSDENIED              = E_ACCESSDENIED;
  1393.   {$EXTERNALSYM DSERR_ACCESSDENIED}
  1394.   // Tried to create a DSBCAPS_CTRLFX buffer shorter than DSBSIZE_FX_MIN milliseconds
  1395.   DSERR_BUFFERTOOSMALL            = MAKE_DSHRESULT_R or 180; // MAKE_DSHRESULT(180)
  1396.   {$EXTERNALSYM DSERR_BUFFERTOOSMALL}
  1397.   // Attempt to use DirectSound 8 functionality on an older DirectSound object
  1398.   DSERR_DS8_REQUIRED              = MAKE_DSHRESULT_R or 190; // MAKE_DSHRESULT(190)
  1399.   {$EXTERNALSYM DSERR_DS8_REQUIRED}
  1400.   // A circular loop of send effects was detected
  1401.   DSERR_SENDLOOP                  = MAKE_DSHRESULT_R or 200; // MAKE_DSHRESULT(200)
  1402.   {$EXTERNALSYM DSERR_SENDLOOP}
  1403.   // The GUID specified in an audiopath file does not match a valid MIXIN buffer
  1404.   DSERR_BADSENDBUFFERGUID         = MAKE_DSHRESULT_R or 210; // MAKE_DSHRESULT(210)
  1405.   {$EXTERNALSYM DSERR_BADSENDBUFFERGUID}
  1406.   // The object requested was not found (numerically equal to DMUS_E_NOT_FOUND)
  1407.   DSERR_OBJECTNOTFOUND            = MAKE_DSHRESULT_R or 4449; // MAKE_DSHRESULT(4449)
  1408.   {$EXTERNALSYM DSERR_OBJECTNOTFOUND}
  1409.   // The effects requested could not be found on the system, or they were found
  1410.   // but in the wrong order, or in the wrong hardware/software locations.
  1411.   DSERR_FXUNAVAILABLE             = MAKE_DSHRESULT_R or 220; // MAKE_DSHRESULT(220)
  1412.   {$EXTERNALSYM DSERR_FXUNAVAILABLE}
  1413.   //
  1414.   // Flags
  1415.   //
  1416.   DSCAPS_PRIMARYMONO          = $00000001;
  1417.   {$EXTERNALSYM DSCAPS_PRIMARYMONO}
  1418.   DSCAPS_PRIMARYSTEREO        = $00000002;
  1419.   {$EXTERNALSYM DSCAPS_PRIMARYSTEREO}
  1420.   DSCAPS_PRIMARY8BIT          = $00000004;
  1421.   {$EXTERNALSYM DSCAPS_PRIMARY8BIT}
  1422.   DSCAPS_PRIMARY16BIT         = $00000008;
  1423.   {$EXTERNALSYM DSCAPS_PRIMARY16BIT}
  1424.   DSCAPS_CONTINUOUSRATE       = $00000010;
  1425.   {$EXTERNALSYM DSCAPS_CONTINUOUSRATE}
  1426.   DSCAPS_EMULDRIVER           = $00000020;
  1427.   {$EXTERNALSYM DSCAPS_EMULDRIVER}
  1428.   DSCAPS_CERTIFIED            = $00000040;
  1429.   {$EXTERNALSYM DSCAPS_CERTIFIED}
  1430.   DSCAPS_SECONDARYMONO        = $00000100;
  1431.   {$EXTERNALSYM DSCAPS_SECONDARYMONO}
  1432.   DSCAPS_SECONDARYSTEREO      = $00000200;
  1433.   {$EXTERNALSYM DSCAPS_SECONDARYSTEREO}
  1434.   DSCAPS_SECONDARY8BIT        = $00000400;
  1435.   {$EXTERNALSYM DSCAPS_SECONDARY8BIT}
  1436.   DSCAPS_SECONDARY16BIT       = $00000800;
  1437.   {$EXTERNALSYM DSCAPS_SECONDARY16BIT}
  1438.   DSSCL_NORMAL                = $00000001;
  1439.   {$EXTERNALSYM DSSCL_NORMAL}
  1440.   DSSCL_PRIORITY              = $00000002;
  1441.   {$EXTERNALSYM DSSCL_PRIORITY}
  1442.   DSSCL_EXCLUSIVE             = $00000003;
  1443.   {$EXTERNALSYM DSSCL_EXCLUSIVE}
  1444.   DSSCL_WRITEPRIMARY          = $00000004;
  1445.   {$EXTERNALSYM DSSCL_WRITEPRIMARY}
  1446.   DSSPEAKER_DIRECTOUT         = $00000000;
  1447.   {$EXTERNALSYM DSSPEAKER_DIRECTOUT}
  1448.   DSSPEAKER_HEADPHONE         = $00000001;
  1449.   {$EXTERNALSYM DSSPEAKER_HEADPHONE}
  1450.   DSSPEAKER_MONO              = $00000002;
  1451.   {$EXTERNALSYM DSSPEAKER_MONO}
  1452.   DSSPEAKER_QUAD              = $00000003;
  1453.   {$EXTERNALSYM DSSPEAKER_QUAD}
  1454.   DSSPEAKER_STEREO            = $00000004;
  1455.   {$EXTERNALSYM DSSPEAKER_STEREO}
  1456.   DSSPEAKER_SURROUND          = $00000005;
  1457.   {$EXTERNALSYM DSSPEAKER_SURROUND}
  1458.   DSSPEAKER_5POINT1           = $00000006;
  1459.   {$EXTERNALSYM DSSPEAKER_5POINT1}
  1460.   DSSPEAKER_7POINT1           = $00000007;
  1461.   {$EXTERNALSYM DSSPEAKER_7POINT1}
  1462.   DSSPEAKER_GEOMETRY_MIN      = $00000005;  //   5 degrees
  1463.   {$EXTERNALSYM DSSPEAKER_GEOMETRY_MIN}
  1464.   DSSPEAKER_GEOMETRY_NARROW   = $0000000A;  //  10 degrees
  1465.   {$EXTERNALSYM DSSPEAKER_GEOMETRY_NARROW}
  1466.   DSSPEAKER_GEOMETRY_WIDE     = $00000014;  //  20 degrees
  1467.   {$EXTERNALSYM DSSPEAKER_GEOMETRY_WIDE}
  1468.   DSSPEAKER_GEOMETRY_MAX      = $000000B4;  // 180 degrees
  1469.   {$EXTERNALSYM DSSPEAKER_GEOMETRY_MAX}
  1470. // #define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
  1471. function DSSPEAKER_COMBINED(c, g: DWORD): DWORD;
  1472. {$EXTERNALSYM DSSPEAKER_COMBINED}
  1473. // #define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
  1474. function DSSPEAKER_CONFIG(a: Cardinal): Byte;
  1475. {$EXTERNALSYM DSSPEAKER_CONFIG}
  1476. // #define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
  1477. function DSSPEAKER_GEOMETRY(a: Cardinal): Byte;
  1478. {$EXTERNALSYM DSSPEAKER_GEOMETRY}
  1479. const
  1480.   DSBCAPS_PRIMARYBUFFER       = $00000001;
  1481.   {$EXTERNALSYM DSBCAPS_PRIMARYBUFFER}
  1482.   DSBCAPS_STATIC              = $00000002;
  1483.   {$EXTERNALSYM DSBCAPS_STATIC}
  1484.   DSBCAPS_LOCHARDWARE         = $00000004;
  1485.   {$EXTERNALSYM DSBCAPS_LOCHARDWARE}
  1486.   DSBCAPS_LOCSOFTWARE         = $00000008;
  1487.   {$EXTERNALSYM DSBCAPS_LOCSOFTWARE}
  1488.   DSBCAPS_CTRL3D              = $00000010;
  1489.   {$EXTERNALSYM DSBCAPS_CTRL3D}
  1490.   DSBCAPS_CTRLFREQUENCY       = $00000020;
  1491.   {$EXTERNALSYM DSBCAPS_CTRLFREQUENCY}
  1492.   DSBCAPS_CTRLPAN             = $00000040;
  1493.   {$EXTERNALSYM DSBCAPS_CTRLPAN}
  1494.   DSBCAPS_CTRLVOLUME          = $00000080;
  1495.   {$EXTERNALSYM DSBCAPS_CTRLVOLUME}
  1496.   DSBCAPS_CTRLPOSITIONNOTIFY  = $00000100;
  1497.   {$EXTERNALSYM DSBCAPS_CTRLPOSITIONNOTIFY}
  1498.   DSBCAPS_CTRLFX              = $00000200;
  1499.   {$EXTERNALSYM DSBCAPS_CTRLFX}
  1500.   DSBCAPS_STICKYFOCUS         = $00004000;
  1501.   {$EXTERNALSYM DSBCAPS_STICKYFOCUS}
  1502.   DSBCAPS_GLOBALFOCUS         = $00008000;
  1503.   {$EXTERNALSYM DSBCAPS_GLOBALFOCUS}
  1504.   DSBCAPS_GETCURRENTPOSITION2 = $00010000;
  1505.   {$EXTERNALSYM DSBCAPS_GETCURRENTPOSITION2}
  1506.   DSBCAPS_MUTE3DATMAXDISTANCE = $00020000;
  1507.   {$EXTERNALSYM DSBCAPS_MUTE3DATMAXDISTANCE}
  1508.   DSBCAPS_LOCDEFER            = $00040000;
  1509.   {$EXTERNALSYM DSBCAPS_LOCDEFER}
  1510.   DSBPLAY_LOOPING             = $00000001;
  1511.   {$EXTERNALSYM DSBPLAY_LOOPING}
  1512.   DSBPLAY_LOCHARDWARE         = $00000002;
  1513.   {$EXTERNALSYM DSBPLAY_LOCHARDWARE}
  1514.   DSBPLAY_LOCSOFTWARE         = $00000004;
  1515.   {$EXTERNALSYM DSBPLAY_LOCSOFTWARE}
  1516.   DSBPLAY_TERMINATEBY_TIME    = $00000008;
  1517.   {$EXTERNALSYM DSBPLAY_TERMINATEBY_TIME}
  1518.   DSBPLAY_TERMINATEBY_DISTANCE    = $000000010;
  1519.   {$EXTERNALSYM DSBPLAY_TERMINATEBY_DISTANCE}
  1520.   DSBPLAY_TERMINATEBY_PRIORITY    = $000000020;
  1521.   {$EXTERNALSYM DSBPLAY_TERMINATEBY_PRIORITY}
  1522.   DSBSTATUS_PLAYING           = $00000001;
  1523.   {$EXTERNALSYM DSBSTATUS_PLAYING}
  1524.   DSBSTATUS_BUFFERLOST        = $00000002;
  1525.   {$EXTERNALSYM DSBSTATUS_BUFFERLOST}
  1526.   DSBSTATUS_LOOPING           = $00000004;
  1527.   {$EXTERNALSYM DSBSTATUS_LOOPING}
  1528.   DSBSTATUS_LOCHARDWARE       = $00000008;
  1529.   {$EXTERNALSYM DSBSTATUS_LOCHARDWARE}
  1530.   DSBSTATUS_LOCSOFTWARE       = $00000010;
  1531.   {$EXTERNALSYM DSBSTATUS_LOCSOFTWARE}
  1532.   DSBSTATUS_TERMINATED        = $00000020;
  1533.   {$EXTERNALSYM DSBSTATUS_TERMINATED}
  1534.   DSBLOCK_FROMWRITECURSOR     = $00000001;
  1535.   {$EXTERNALSYM DSBLOCK_FROMWRITECURSOR}
  1536.   DSBLOCK_ENTIREBUFFER        = $00000002;
  1537.   {$EXTERNALSYM DSBLOCK_ENTIREBUFFER}
  1538.   DSBFREQUENCY_ORIGINAL       = 0;
  1539.   {$EXTERNALSYM DSBFREQUENCY_ORIGINAL}
  1540.   DSBFREQUENCY_MIN            = 100;
  1541.   {$EXTERNALSYM DSBFREQUENCY_MIN}
  1542. {$IFDEF DIRECTSOUND_VERSION_9} // #if DIRECTSOUND_VERSION >= 0x0900
  1543.   DSBFREQUENCY_MAX            = 200000;
  1544.   {$EXTERNALSYM DSBFREQUENCY_MAX}
  1545. {$ELSE}
  1546.   DSBFREQUENCY_MAX            = 100000;
  1547.   {$EXTERNALSYM DSBFREQUENCY_MAX}
  1548. {$ENDIF}
  1549.   DSBPAN_LEFT                 = -10000;
  1550.   {$EXTERNALSYM DSBPAN_LEFT}
  1551.   DSBPAN_CENTER               = 0;
  1552.   {$EXTERNALSYM DSBPAN_CENTER}
  1553.   DSBPAN_RIGHT                = 10000;
  1554.   {$EXTERNALSYM DSBPAN_RIGHT}
  1555.   DSBVOLUME_MIN               = -10000;
  1556.   {$EXTERNALSYM DSBVOLUME_MIN}
  1557.   DSBVOLUME_MAX               = 0;
  1558.   {$EXTERNALSYM DSBVOLUME_MAX}
  1559.   DSBSIZE_MIN                 = 4;
  1560.   {$EXTERNALSYM DSBSIZE_MIN}
  1561.   DSBSIZE_MAX                 = $0FFFFFFF;
  1562.   {$EXTERNALSYM DSBSIZE_MAX}
  1563.   DSBSIZE_FX_MIN              = 150;  // NOTE: Milliseconds, not bytes
  1564.   {$EXTERNALSYM DSBSIZE_FX_MIN}
  1565.   DS3DMODE_NORMAL             = $00000000;
  1566.   {$EXTERNALSYM DS3DMODE_NORMAL}
  1567.   DS3DMODE_HEADRELATIVE       = $00000001;
  1568.   {$EXTERNALSYM DS3DMODE_HEADRELATIVE}
  1569.   DS3DMODE_DISABLE            = $00000002;
  1570.   {$EXTERNALSYM DS3DMODE_DISABLE}
  1571.   DS3D_IMMEDIATE              = $00000000;
  1572.   {$EXTERNALSYM DS3D_IMMEDIATE}
  1573.   DS3D_DEFERRED               = $00000001;
  1574.   {$EXTERNALSYM DS3D_DEFERRED}
  1575. var
  1576.   // Forced to define as 'var' cos pascal compiler treats all consts as Double
  1577.   DS3D_MINDISTANCEFACTOR: Single = 1.175494351e-38; // FLT_MIN;
  1578.   {$EXTERNALSYM DS3D_MINDISTANCEFACTOR}
  1579.   DS3D_MAXDISTANCEFACTOR: Single = 3.402823466e+38; // FLT_MAX;
  1580.   {$EXTERNALSYM DS3D_MAXDISTANCEFACTOR}
  1581. const
  1582.   DS3D_DEFAULTDISTANCEFACTOR  = 1.0;
  1583.   {$EXTERNALSYM DS3D_DEFAULTDISTANCEFACTOR}
  1584.   DS3D_MINROLLOFFFACTOR       = 0.0;
  1585.   {$EXTERNALSYM DS3D_MINROLLOFFFACTOR}
  1586.   DS3D_MAXROLLOFFFACTOR       = 10.0;
  1587.   {$EXTERNALSYM DS3D_MAXROLLOFFFACTOR}
  1588.   DS3D_DEFAULTROLLOFFFACTOR   = 1.0;
  1589.   {$EXTERNALSYM DS3D_DEFAULTROLLOFFFACTOR}
  1590.   DS3D_MINDOPPLERFACTOR       = 0.0;
  1591.   {$EXTERNALSYM DS3D_MINDOPPLERFACTOR}
  1592.   DS3D_MAXDOPPLERFACTOR       = 10.0;
  1593.   {$EXTERNALSYM DS3D_MAXDOPPLERFACTOR}
  1594.   DS3D_DEFAULTDOPPLERFACTOR   = 1.0;
  1595.   {$EXTERNALSYM DS3D_DEFAULTDOPPLERFACTOR}
  1596.   DS3D_DEFAULTMINDISTANCE     = 1.0;
  1597.   {$EXTERNALSYM DS3D_DEFAULTMINDISTANCE}
  1598.   DS3D_DEFAULTMAXDISTANCE     = 1000000000.0;
  1599.   {$EXTERNALSYM DS3D_DEFAULTMAXDISTANCE}
  1600.   DS3D_MINCONEANGLE           = 0;
  1601.   {$EXTERNALSYM DS3D_MINCONEANGLE}
  1602.   DS3D_MAXCONEANGLE           = 360;
  1603.   {$EXTERNALSYM DS3D_MAXCONEANGLE}
  1604.   DS3D_DEFAULTCONEANGLE       = 360;
  1605.   {$EXTERNALSYM DS3D_DEFAULTCONEANGLE}
  1606.   DS3D_DEFAULTCONEOUTSIDEVOLUME = DSBVOLUME_MAX;
  1607.   {$EXTERNALSYM DS3D_DEFAULTCONEOUTSIDEVOLUME}
  1608.   // IDirectSoundCapture attributes
  1609.   DSCCAPS_EMULDRIVER          = DSCAPS_EMULDRIVER;
  1610.   {$EXTERNALSYM DSCCAPS_EMULDRIVER}
  1611.   DSCCAPS_CERTIFIED           = DSCAPS_CERTIFIED;
  1612.   {$EXTERNALSYM DSCCAPS_CERTIFIED}
  1613.   DSCCAPS_MULTIPLECAPTURE     = $00000001;
  1614.   {$EXTERNALSYM DSCCAPS_MULTIPLECAPTURE}
  1615.   // IDirectSoundCaptureBuffer attributes
  1616.   DSCBCAPS_WAVEMAPPED         = $80000000;
  1617.   {$EXTERNALSYM DSCBCAPS_WAVEMAPPED}
  1618. {$IFDEF DIRECTSOUND_VERSION_8} // #if DIRECTSOUND_VERSION >= 0x0800
  1619.   DSCBCAPS_CTRLFX             = $00000200;
  1620.   {$EXTERNALSYM DSCBCAPS_CTRLFX}
  1621. {$ENDIF} // DIRECTSOUND_VERSION >= 0x0800
  1622.   DSCBLOCK_ENTIREBUFFER       = $00000001;
  1623.   {$EXTERNALSYM DSCBLOCK_ENTIREBUFFER}
  1624.   DSCBSTATUS_CAPTURING        = $00000001;
  1625.   {$EXTERNALSYM DSCBSTATUS_CAPTURING}
  1626.   DSCBSTATUS_LOOPING          = $00000002;
  1627.   {$EXTERNALSYM DSCBSTATUS_LOOPING}
  1628.   DSCBSTART_LOOPING           = $00000001;
  1629.   {$EXTERNALSYM DSCBSTART_LOOPING}
  1630.   DSBPN_OFFSETSTOP            = $FFFFFFFF;
  1631.   {$EXTERNALSYM DSBPN_OFFSETSTOP}
  1632.   DS_CERTIFIED                = $00000000;
  1633.   {$EXTERNALSYM DS_CERTIFIED}
  1634.   DS_UNCERTIFIED              = $00000001;
  1635.   {$EXTERNALSYM DS_UNCERTIFIED}
  1636.   //
  1637.   // Flags for the I3DL2 effects
  1638.   //
  1639.   //
  1640.   // I3DL2 Material Presets
  1641.   //
  1642.   DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW = 0;
  1643.   {$EXTERNALSYM DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW}
  1644.   DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW = 1;
  1645.   {$EXTERNALSYM DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW}
  1646.   DSFX_I3DL2_MATERIAL_PRESET_THINDOOR     = 2;
  1647.   {$EXTERNALSYM DSFX_I3DL2_MATERIAL_PRESET_THINDOOR}
  1648.   DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR    = 3;
  1649.   {$EXTERNALSYM DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR}
  1650.   DSFX_I3DL2_MATERIAL_PRESET_WOODWALL     = 4;
  1651.   {$EXTERNALSYM DSFX_I3DL2_MATERIAL_PRESET_WOODWALL}
  1652.   DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL    = 5;
  1653.   {$EXTERNALSYM DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL}
  1654.   DSFX_I3DL2_MATERIAL_PRESET_STONEWALL    = 6;
  1655.   {$EXTERNALSYM DSFX_I3DL2_MATERIAL_PRESET_STONEWALL}
  1656.   DSFX_I3DL2_MATERIAL_PRESET_CURTAIN      = 7;
  1657.   {$EXTERNALSYM DSFX_I3DL2_MATERIAL_PRESET_CURTAIN}
  1658. //Translator: have not found where these defines are used
  1659. {
  1660. #define I3DL2_MATERIAL_PRESET_SINGLEWINDOW    -2800,0.71f
  1661. #define I3DL2_MATERIAL_PRESET_DOUBLEWINDOW    -5000,0.40f
  1662. #define I3DL2_MATERIAL_PRESET_THINDOOR        -1800,0.66f
  1663. #define I3DL2_MATERIAL_PRESET_THICKDOOR       -4400,0.64f
  1664. #define I3DL2_MATERIAL_PRESET_WOODWALL        -4000,0.50f
  1665. #define I3DL2_MATERIAL_PRESET_BRICKWALL       -5000,0.60f
  1666. #define I3DL2_MATERIAL_PRESET_STONEWALL       -6000,0.68f
  1667. #define I3DL2_MATERIAL_PRESET_CURTAIN         -1200,0.15f
  1668. }
  1669.   DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT         = 0;
  1670.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT}
  1671.   DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC         = 1;
  1672.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC}
  1673.   DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL      = 2;
  1674.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL}
  1675.   DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM            = 3;
  1676.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM}
  1677.   DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM        = 4;
  1678.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM}
  1679.   DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM      = 5;
  1680.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM}
  1681.   DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM       = 6;
  1682.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM}
  1683.   DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM      = 7;
  1684.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM}
  1685.   DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL     = 8;
  1686.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL}
  1687.   DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE            = 9;
  1688.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE}
  1689.   DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA           = 10;
  1690.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA}
  1691.   DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR          = 11;
  1692.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR}
  1693.   DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY = 12;
  1694.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY}
  1695.   DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY         = 13;
  1696.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY}
  1697.   DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR   = 14;
  1698.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR}
  1699.   DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY           = 15;
  1700.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY}
  1701.   DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST          = 16;
  1702.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST}
  1703.   DSFX_I3DL2_ENVIRONMENT_PRESET_CITY            = 17;
  1704.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_CITY}
  1705.   DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS       = 18;
  1706.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS}
  1707.   DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY          = 19;
  1708.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY}
  1709.   DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN           = 20;
  1710.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN}
  1711.   DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT      = 21;
  1712.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT}
  1713.   DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE       = 22;
  1714.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE}
  1715.   DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER      = 23;
  1716.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER}
  1717.   DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM       = 24;
  1718.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM}
  1719.   DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM      = 25;
  1720.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM}
  1721.   DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM       = 26;
  1722.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM}
  1723.   DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL      = 27;
  1724.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL}
  1725.   DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL       = 28;
  1726.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL}
  1727.   DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE           = 29;
  1728.   {$EXTERNALSYM DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE}
  1729.   //
  1730.   // I3DL2 Reverberation Presets Values
  1731.   //
  1732.   I3DL2_ENVIRONMENT_PRESET_DEFAULT         : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -100; flRoomRolloffFactor: 0.0; flDecayTime: 1.49; flDecayHFRatio: 0.83; lReflections: -2602; flReflectionsDelay: 0.007; lReverb:   200; flReverbDelay: 0.011; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1733.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_DEFAULT}
  1734.   I3DL2_ENVIRONMENT_PRESET_GENERIC         : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -100; flRoomRolloffFactor: 0.0; flDecayTime: 1.49; flDecayHFRatio: 0.83; lReflections: -2602; flReflectionsDelay: 0.007; lReverb:   200; flReverbDelay: 0.011; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1735.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_GENERIC}
  1736.   I3DL2_ENVIRONMENT_PRESET_PADDEDCELL      : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF: -6000; flRoomRolloffFactor: 0.0; flDecayTime: 0.17; flDecayHFRatio: 0.10; lReflections: -1204; flReflectionsDelay: 0.001; lReverb:   207; flReverbDelay: 0.002; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1737.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_PADDEDCELL}
  1738.   I3DL2_ENVIRONMENT_PRESET_ROOM            : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -454; flRoomRolloffFactor: 0.0; flDecayTime: 0.40; flDecayHFRatio: 0.83; lReflections: -1646; flReflectionsDelay: 0.002; lReverb:    53; flReverbDelay: 0.003; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1739.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_ROOM}
  1740.   I3DL2_ENVIRONMENT_PRESET_BATHROOM        : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF: -1200; flRoomRolloffFactor: 0.0; flDecayTime: 1.49; flDecayHFRatio: 0.54; lReflections:  -370; flReflectionsDelay: 0.007; lReverb:  1030; flReverbDelay: 0.011; flDiffusion: 100.0; flDensity:  60.0; flHFReference: 5000.0);
  1741.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_BATHROOM}
  1742.   I3DL2_ENVIRONMENT_PRESET_LIVINGROOM      : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF: -6000; flRoomRolloffFactor: 0.0; flDecayTime: 0.50; flDecayHFRatio: 0.10; lReflections: -1376; flReflectionsDelay: 0.003; lReverb: -1104; flReverbDelay: 0.004; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1743.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_LIVINGROOM}
  1744.   I3DL2_ENVIRONMENT_PRESET_STONEROOM       : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -300; flRoomRolloffFactor: 0.0; flDecayTime: 2.31; flDecayHFRatio: 0.64; lReflections:  -711; flReflectionsDelay: 0.012; lReverb:    83; flReverbDelay: 0.017; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1745.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_STONEROOM}
  1746.   I3DL2_ENVIRONMENT_PRESET_AUDITORIUM      : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -476; flRoomRolloffFactor: 0.0; flDecayTime: 4.32; flDecayHFRatio: 0.59; lReflections:  -789; flReflectionsDelay: 0.020; lReverb:  -289; flReverbDelay: 0.030; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1747.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_AUDITORIUM}
  1748.   I3DL2_ENVIRONMENT_PRESET_CONCERTHALL     : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -500; flRoomRolloffFactor: 0.0; flDecayTime: 3.92; flDecayHFRatio: 0.70; lReflections: -1230; flReflectionsDelay: 0.020; lReverb:    -2; flReverbDelay: 0.029; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1749.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_CONCERTHALL}
  1750.   I3DL2_ENVIRONMENT_PRESET_CAVE            : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:     0; flRoomRolloffFactor: 0.0; flDecayTime: 2.91; flDecayHFRatio: 1.30; lReflections:  -602; flReflectionsDelay: 0.015; lReverb:  -302; flReverbDelay: 0.022; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1751.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_CAVE}
  1752.   I3DL2_ENVIRONMENT_PRESET_ARENA           : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -698; flRoomRolloffFactor: 0.0; flDecayTime: 7.24; flDecayHFRatio: 0.33; lReflections: -1166; flReflectionsDelay: 0.020; lReverb:    16; flReverbDelay: 0.030; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1753.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_ARENA}
  1754.   I3DL2_ENVIRONMENT_PRESET_HANGAR          : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF: -1000; flRoomRolloffFactor: 0.0; flDecayTime:10.05; flDecayHFRatio: 0.23; lReflections:  -602; flReflectionsDelay: 0.020; lReverb:   198; flReverbDelay: 0.030; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1755.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_HANGAR}
  1756.   I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF: -4000; flRoomRolloffFactor: 0.0; flDecayTime: 0.30; flDecayHFRatio: 0.10; lReflections: -1831; flReflectionsDelay: 0.002; lReverb: -1630; flReverbDelay: 0.030; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1757.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY}
  1758.   I3DL2_ENVIRONMENT_PRESET_HALLWAY         : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -300; flRoomRolloffFactor: 0.0; flDecayTime: 1.49; flDecayHFRatio: 0.59; lReflections: -1219; flReflectionsDelay: 0.007; lReverb:   441; flReverbDelay: 0.011; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1759.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_HALLWAY}
  1760.   I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR   : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -237; flRoomRolloffFactor: 0.0; flDecayTime: 2.70; flDecayHFRatio: 0.79; lReflections: -1214; flReflectionsDelay: 0.013; lReverb:   395; flReverbDelay: 0.020; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1761.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR}
  1762.   I3DL2_ENVIRONMENT_PRESET_ALLEY           : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -270; flRoomRolloffFactor: 0.0; flDecayTime: 1.49; flDecayHFRatio: 0.86; lReflections: -1204; flReflectionsDelay: 0.007; lReverb:    -4; flReverbDelay: 0.011; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1763.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_ALLEY}
  1764.   I3DL2_ENVIRONMENT_PRESET_FOREST          : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF: -3300; flRoomRolloffFactor: 0.0; flDecayTime: 1.49; flDecayHFRatio: 0.54; lReflections: -2560; flReflectionsDelay: 0.162; lReverb:  -613; flReverbDelay: 0.088; flDiffusion:  79.0; flDensity: 100.0; flHFReference: 5000.0);
  1765.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_FOREST}
  1766.   I3DL2_ENVIRONMENT_PRESET_CITY            : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -800; flRoomRolloffFactor: 0.0; flDecayTime: 1.49; flDecayHFRatio: 0.67; lReflections: -2273; flReflectionsDelay: 0.007; lReverb: -2217; flReverbDelay: 0.011; flDiffusion:  50.0; flDensity: 100.0; flHFReference: 5000.0);
  1767.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_CITY}
  1768.   I3DL2_ENVIRONMENT_PRESET_MOUNTAINS       : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF: -2500; flRoomRolloffFactor: 0.0; flDecayTime: 1.49; flDecayHFRatio: 0.21; lReflections: -2780; flReflectionsDelay: 0.300; lReverb: -2014; flReverbDelay: 0.100; flDiffusion:  27.0; flDensity: 100.0; flHFReference: 5000.0);
  1769.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_MOUNTAINS}
  1770.   I3DL2_ENVIRONMENT_PRESET_QUARRY          : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF: -1000; flRoomRolloffFactor: 0.0; flDecayTime: 1.49; flDecayHFRatio: 0.83; lReflections:-10000; flReflectionsDelay: 0.061; lReverb:   500; flReverbDelay: 0.025; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1771.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_QUARRY}
  1772.   I3DL2_ENVIRONMENT_PRESET_PLAIN           : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF: -2000; flRoomRolloffFactor: 0.0; flDecayTime: 1.49; flDecayHFRatio: 0.50; lReflections: -2466; flReflectionsDelay: 0.179; lReverb: -2514; flReverbDelay: 0.100; flDiffusion:  21.0; flDensity: 100.0; flHFReference: 5000.0);
  1773.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_PLAIN}
  1774.   I3DL2_ENVIRONMENT_PRESET_PARKINGLOT      : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:     0; flRoomRolloffFactor: 0.0; flDecayTime: 1.65; flDecayHFRatio: 1.50; lReflections: -1363; flReflectionsDelay: 0.008; lReverb: -1153; flReverbDelay: 0.012; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1775.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_PARKINGLOT}
  1776.   I3DL2_ENVIRONMENT_PRESET_SEWERPIPE       : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF: -1000; flRoomRolloffFactor: 0.0; flDecayTime: 2.81; flDecayHFRatio: 0.14; lReflections:   429; flReflectionsDelay: 0.014; lReverb:   648; flReverbDelay: 0.021; flDiffusion:  80.0; flDensity:  60.0; flHFReference: 5000.0);
  1777.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_SEWERPIPE}
  1778.   I3DL2_ENVIRONMENT_PRESET_UNDERWATER      : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF: -4000; flRoomRolloffFactor: 0.0; flDecayTime: 1.49; flDecayHFRatio: 0.10; lReflections:  -449; flReflectionsDelay: 0.007; lReverb:  1700; flReverbDelay: 0.011; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1779.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_UNDERWATER}
  1780.   //
  1781.   // Examples simulating 'musical' reverb presets
  1782.   //
  1783.   // Name       Decay time   Description
  1784.   // Small Room    1.1s      A small size room with a length of 5m or so.
  1785.   // Medium Room   1.3s      A medium size room with a length of 10m or so.
  1786.   // Large Room    1.5s      A large size room suitable for live performances.
  1787.   // Medium Hall   1.8s      A medium size concert hall.
  1788.   // Large Hall    1.8s      A large size concert hall suitable for a full orchestra.
  1789.   // Plate         1.3s      A plate reverb simulation.
  1790.   //
  1791.   I3DL2_ENVIRONMENT_PRESET_SMALLROOM       : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -600; flRoomRolloffFactor: 0.0; flDecayTime: 1.10; flDecayHFRatio: 0.83; lReflections:  -400; flReflectionsDelay: 0.005; lReverb:   500; flReverbDelay: 0.010; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1792.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_SMALLROOM}
  1793.   I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM      : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -600; flRoomRolloffFactor: 0.0; flDecayTime: 1.30; flDecayHFRatio: 0.83; lReflections: -1000; flReflectionsDelay: 0.010; lReverb:  -200; flReverbDelay: 0.020; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1794.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM}
  1795.   I3DL2_ENVIRONMENT_PRESET_LARGEROOM       : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -600; flRoomRolloffFactor: 0.0; flDecayTime: 1.50; flDecayHFRatio: 0.83; lReflections: -1600; flReflectionsDelay: 0.020; lReverb: -1000; flReverbDelay: 0.040; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1796.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_LARGEROOM}
  1797.   I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL      : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -600; flRoomRolloffFactor: 0.0; flDecayTime: 1.80; flDecayHFRatio: 0.70; lReflections: -1300; flReflectionsDelay: 0.015; lReverb:  -800; flReverbDelay: 0.030; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1798.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL}
  1799.   I3DL2_ENVIRONMENT_PRESET_LARGEHALL       : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -600; flRoomRolloffFactor: 0.0; flDecayTime: 1.80; flDecayHFRatio: 0.70; lReflections: -2000; flReflectionsDelay: 0.030; lReverb: -1400; flReverbDelay: 0.060; flDiffusion: 100.0; flDensity: 100.0; flHFReference: 5000.0);
  1800.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_LARGEHALL}
  1801.   I3DL2_ENVIRONMENT_PRESET_PLATE           : TDSFXI3DL2Reverb = (lRoom: -1000; lRoomHF:  -200; flRoomRolloffFactor: 0.0; flDecayTime: 1.30; flDecayHFRatio: 0.90; lReflections:     0; flReflectionsDelay: 0.002; lReverb:     0; flReverbDelay: 0.010; flDiffusion: 100.0; flDensity:  75.0; flHFReference: 5000.0);
  1802.   {$EXTERNALSYM I3DL2_ENVIRONMENT_PRESET_PLATE}
  1803.   //
  1804.   // DirectSound3D Algorithms
  1805.   //
  1806.   // Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000}
  1807.   DS3DALG_DEFAULT : TGUID = '{00000000-0000-0000-0000-000000000000}'; // GUID_NULL;
  1808.   {$EXTERNALSYM DS3DALG_DEFAULT}
  1809.   // No virtualization (Pan3D) {C241333F-1C1B-11d2-94F5-00C04FC28ACA}
  1810.   DS3DALG_NO_VIRTUALIZATION: TGUID = '{c241333f-1c1b-11d2-94f5-00c04fc28aca}';
  1811.   {$EXTERNALSYM DS3DALG_NO_VIRTUALIZATION}
  1812.   // High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA}
  1813.   DS3DALG_HRTF_FULL: TGUID = '{c2413340-1c1b-11d2-94f5-00c04fc28aca}';
  1814.   {$EXTERNALSYM DS3DALG_HRTF_FULL}
  1815.   // Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA}
  1816.   DS3DALG_HRTF_LIGHT: TGUID = '{c2413342-1c1b-11d2-94f5-00c04fc28aca}';
  1817.   {$EXTERNALSYM DS3DALG_HRTF_LIGHT}
  1818. {$IFDEF DIRECTSOUND_VERSION_8} // #if DIRECTSOUND_VERSION >= 0x0800
  1819.   //
  1820.   // DirectSound Internal Effect Algorithms
  1821.   //
  1822.   // Gargle {DAFD8210-5711-4B91-9FE3-F75B7AE279BF}
  1823.   GUID_DSFX_STANDARD_GARGLE: TGUID = '{dafd8210-5711-4b91-9fe3-f75b7ae279bf}';
  1824.   {$EXTERNALSYM GUID_DSFX_STANDARD_GARGLE}
  1825.   // Chorus {EFE6629C-81F7-4281-BD91-C9D604A95AF6}
  1826.   GUID_DSFX_STANDARD_CHORUS: TGUID = '{efe6629c-81f7-4281-bd91-c9d604a95af6}';
  1827.   {$EXTERNALSYM GUID_DSFX_STANDARD_CHORUS}
  1828.   // Flanger {EFCA3D92-DFD8-4672-A603-7420894BAD98}
  1829.   GUID_DSFX_STANDARD_FLANGER: TGUID = '{efca3d92-dfd8-4672-a603-7420894bad98}';
  1830.   {$EXTERNALSYM GUID_DSFX_STANDARD_FLANGER}
  1831.   // Echo/Delay {EF3E932C-D40B-4F51-8CCF-3F98F1B29D5D}
  1832.   GUID_DSFX_STANDARD_ECHO: TGUID = '{ef3e932c-d40b-4f51-8ccf-3f98f1b29d5d}';
  1833.   {$EXTERNALSYM GUID_DSFX_STANDARD_ECHO}
  1834.   // Distortion {EF114C90-CD1D-484E-96E5-09CFAF912A21}
  1835.   GUID_DSFX_STANDARD_DISTORTION: TGUID = '{ef114c90-cd1d-484e-96e5-09cfaf912a21}';
  1836.   {$EXTERNALSYM GUID_DSFX_STANDARD_DISTORTION}
  1837.   // Compressor/Limiter {EF011F79-4000-406D-87AF-BFFB3FC39D57}
  1838.   GUID_DSFX_STANDARD_COMPRESSOR: TGUID = '{ef011f79-4000-406d-87af-bffb3fc39d57}';
  1839.   {$EXTERNALSYM GUID_DSFX_STANDARD_COMPRESSOR}
  1840.   // Parametric Equalization {120CED89-3BF4-4173-A132-3CB406CF3231}
  1841.   GUID_DSFX_STANDARD_PARAMEQ: TGUID = '{120ced89-3bf4-4173-a132-3cb406cf3231}';
  1842.   {$EXTERNALSYM GUID_DSFX_STANDARD_PARAMEQ}
  1843.   // I3DL2 Environmental Reverberation: Reverb (Listener) Effect {EF985E71-D5C7-42D4-BA4D-2D073E2E96F4}
  1844.   GUID_DSFX_STANDARD_I3DL2REVERB: TGUID = '{ef985e71-d5c7-42d4-ba4d-2d073e2e96f4}';
  1845.   {$EXTERNALSYM GUID_DSFX_STANDARD_I3DL2REVERB}
  1846.   // Waves Reverberation {87FC0268-9A55-4360-95AA-004A1D9DE26C}
  1847.   GUID_DSFX_WAVES_REVERB: TGUID = '{87fc0268-9a55-4360-95aa-004a1d9de26c}';
  1848.   {$EXTERNALSYM GUID_DSFX_WAVES_REVERB}
  1849.   //
  1850.   // DirectSound Capture Effect Algorithms
  1851.   //
  1852.   // Acoustic Echo Canceller {BF963D80-C559-11D0-8A2B-00A0C9255AC1}
  1853.   // Matches KSNODETYPE_ACOUSTIC_ECHO_CANCEL in ksmedia.h
  1854.   GUID_DSCFX_CLASS_AEC: TGUID = '{BF963D80-C559-11D0-8A2B-00A0C9255AC1}';
  1855.   {$EXTERNALSYM GUID_DSCFX_CLASS_AEC}
  1856.   // Microsoft AEC {CDEBB919-379A-488a-8765-F53CFD36DE40}
  1857.   GUID_DSCFX_MS_AEC: TGUID = '{cdebb919-379a-488a-8765-f53cfd36de40}';
  1858.   {$EXTERNALSYM GUID_DSCFX_MS_AEC}
  1859.   // System AEC {1C22C56D-9879-4f5b-A389-27996DDC2810}
  1860.   GUID_DSCFX_SYSTEM_AEC: TGUID = '{1c22c56d-9879-4f5b-a389-27996ddc2810}';
  1861.   {$EXTERNALSYM GUID_DSCFX_SYSTEM_AEC}
  1862.   // Noise Supression {E07F903F-62FD-4e60-8CDD-DEA7236665B5}
  1863.   // Matches KSNODETYPE_NOISE_SUPPRESS in post Windows ME DDK's ksmedia.h
  1864.   GUID_DSCFX_CLASS_NS: TGUID = '{e07f903f-62fd-4e60-8cdd-dea7236665b5}';
  1865.   {$EXTERNALSYM GUID_DSCFX_CLASS_NS}
  1866.   // Microsoft Noise Suppresion {11C5C73B-66E9-4ba1-A0BA-E814C6EED92D}
  1867.   GUID_DSCFX_MS_NS: TGUID = '{11c5c73b-66e9-4ba1-a0ba-e814c6eed92d}';
  1868.   {$EXTERNALSYM GUID_DSCFX_MS_NS}
  1869.   // System Noise Suppresion {5AB0882E-7274-4516-877D-4EEE99BA4FD0}
  1870.   GUID_DSCFX_SYSTEM_NS: TGUID = '{5ab0882e-7274-4516-877d-4eee99ba4fd0}';
  1871.   {$EXTERNALSYM GUID_DSCFX_SYSTEM_NS}
  1872. {$ENDIF} // DIRECTSOUND_VERSION >= 0x0800
  1873. //
  1874. // DirectSound API
  1875. //
  1876. type
  1877.   TDSEnumCallbackA = function(lpGuid: PGUID; lpcstrDescription, lpcstrModule: PAnsiChar;
  1878.     lpContext: Pointer): BOOL; stdcall;
  1879.   {$NODEFINE TDSEnumCallbackA}
  1880.   TDSEnumCallbackW = function(lpGuid: PGUID; lpcstrDescription, lpcstrModule: PWideChar;
  1881.     lpContext: Pointer): BOOL; stdcall;
  1882.   {$NODEFINE TDSEnumCallbackW}
  1883. {$IFDEF UNICODE}
  1884.   TDSEnumCallback = TDSEnumCallbackW;
  1885. {$ELSE}
  1886.   TDSEnumCallback = TDSEnumCallbackA;
  1887. {$ENDIF}
  1888.   {$NODEFINE TDSEnumCallback}
  1889.   {$HPPEMIT 'typedef LPDSENUMCALLBACKA TDSEnumCallbackA;'}
  1890.   {$HPPEMIT 'typedef LPDSENUMCALLBACKW TDSEnumCallbackW;'}
  1891.   {$HPPEMIT 'typedef LPDSENUMCALLBACK TDSEnumCallback;'}
  1892. const
  1893.   DirectSoundDll = 'dsound.dll';
  1894. function DirectSoundLoaded: Boolean;
  1895. function UnLoadDirectSound: Boolean;
  1896. function LoadDirectSound: Boolean;
  1897. {$IFDEF DIRECTSOUND_DYNAMIC_LINK}
  1898. var
  1899.   DirectSoundCreate: function(lpGuid: PGUID; out ppDS: IDirectSound; pUnkOuter: IUnknown): HResult; stdcall;
  1900.   {$EXTERNALSYM DirectSoundCreate}
  1901.   DirectSoundEnumerateW: function(lpDSEnumCallback: TDSEnumCallbackW; lpContext: Pointer): HResult; stdcall;
  1902.   {$EXTERNALSYM DirectSoundEnumerateW}
  1903.   DirectSoundEnumerateA: function(lpDSEnumCallback: TDSEnumCallbackA; lpContext: Pointer): HResult; stdcall;
  1904.   {$EXTERNALSYM DirectSoundEnumerateA}
  1905.   DirectSoundEnumerate: function(lpDSEnumCallback: TDSEnumCallback; lpContext: Pointer): HResult; stdcall;
  1906.   {$EXTERNALSYM DirectSoundEnumerate}
  1907.   DirectSoundCaptureCreate: function(lpGUID: PGUID; out lplpDSC: IDirectSoundCapture; pUnkOuter: IUnknown): HResult; stdcall;
  1908.   {$EXTERNALSYM DirectSoundCaptureCreate}
  1909.   DirectSoundCaptureEnumerateW: function(lpDSEnumCallback: TDSEnumCallbackW; lpContext: Pointer): HResult; stdcall;
  1910.   {$EXTERNALSYM DirectSoundCaptureEnumerateW}
  1911.   DirectSoundCaptureEnumerateA: function(lpDSEnumCallback: TDSEnumCallbackA; lpContext: Pointer): HResult; stdcall;
  1912.   {$EXTERNALSYM DirectSoundCaptureEnumerateA}
  1913.   DirectSoundCaptureEnumerate: function(lpDSEnumCallback: TDSEnumCallback; lpContext: Pointer): HResult; stdcall;
  1914.   {$EXTERNALSYM DirectSoundCaptureEnumerate}
  1915. //#if DIRECTSOUND_VERSION >= 0x0800
  1916. type
  1917.   TDirectSoundFullDuplexCreateFunc = function(pcGuidCaptureDevice, pcGuidRenderDevice: PGUID;
  1918.     const pcDSCBufferDesc: TDSCBufferDesc; const pcDSBufferDesc: TDSBufferDesc;
  1919.     hWnd: hWnd; dwLevel: DWORD; out ppDSFD: IDirectSoundFullDuplex8;
  1920.     out ppDSCBuffer8: IDirectSoundCaptureBuffer8; out ppDSBuffer8: IDirectSoundBuffer8;
  1921.     pUnkOuter: IUnknown): HResult; stdcall;
  1922. var
  1923.   DirectSoundCreate8: function(pcGuidDevice: PGUID; out ppDS8: IDirectSound8; pUnkOuter: IUnknown): HResult; stdcall;
  1924.   {$EXTERNALSYM DirectSoundCreate8}
  1925.   DirectSoundCaptureCreate8: function(pcGuidDevice: PGUID; out ppDSC8: IDirectSoundCapture8; pUnkOuter: IUnknown): HResult; stdcall;
  1926.   {$EXTERNALSYM DirectSoundCaptureCreate8}
  1927.   DirectSoundFullDuplexCreate: TDirectSoundFullDuplexCreateFunc;
  1928.   {$EXTERNALSYM DirectSoundFullDuplexCreate}
  1929.   DirectSoundFullDuplexCreate8: TDirectSoundFullDuplexCreateFunc;
  1930.   {$EXTERNALSYM DirectSoundFullDuplexCreate8}
  1931.   GetDeviceID: function(pGuidSrc, pGuidDest: PGUID): HResult; stdcall;
  1932.   {$EXTERNALSYM GetDeviceID}
  1933. //#endif // DIRECTSOUND_VERSION >= 0x0800
  1934. {$ELSE}
  1935. function DirectSoundCreate(lpGuid: PGUID; out ppDS: IDirectSound; pUnkOuter: IUnknown): HResult; stdcall; external DirectSoundDLL;
  1936. {$EXTERNALSYM DirectSoundCreate}
  1937. function DirectSoundEnumerateW(lpDSEnumCallback: TDSEnumCallbackW; lpContext: Pointer): HResult; stdcall; external DirectSoundDLL name 'DirectSoundEnumerateW';
  1938. {$EXTERNALSYM DirectSoundEnumerateW}
  1939. function DirectSoundEnumerateA(lpDSEnumCallback: TDSEnumCallbackA; lpContext: Pointer): HResult; stdcall; external DirectSoundDLL name 'DirectSoundEnumerateA';
  1940. {$EXTERNALSYM DirectSoundEnumerateA}
  1941. {$IFDEF UNICODE}
  1942. function DirectSoundEnumerate(lpDSEnumCallback: TDSEnumCallback; lpContext: Pointer): HResult; stdcall; external DirectSoundDLL name 'DirectSoundEnumerateW';
  1943. {$ELSE}
  1944. function DirectSoundEnumerate(lpDSEnumCallback: TDSEnumCallback; lpContext: Pointer): HResult; stdcall; external DirectSoundDLL name 'DirectSoundEnumerateA';
  1945. {$ENDIF}
  1946. {$EXTERNALSYM DirectSoundEnumerate}
  1947. function DirectSoundCaptureCreate(lpGUID: PGUID; out lplpDSC: IDirectSoundCapture; pUnkOuter: IUnknown): HResult; stdcall; external DirectSoundDLL;
  1948. {$EXTERNALSYM DirectSoundCaptureCreate}
  1949. function DirectSoundCaptureEnumerateW(lpDSEnumCallback: TDSEnumCallbackW; lpContext: Pointer): HResult; stdcall; external DirectSoundDLL name 'DirectSoundCaptureEnumerateW';
  1950. {$EXTERNALSYM DirectSoundCaptureEnumerateW}
  1951. function DirectSoundCaptureEnumerateA(lpDSEnumCallback: TDSEnumCallbackA; lpContext: Pointer): HResult; stdcall; external DirectSoundDLL name 'DirectSoundCaptureEnumerateA';
  1952. {$EXTERNALSYM DirectSoundCaptureEnumerateA}
  1953. {$IFDEF UNICODE}
  1954. function DirectSoundCaptureEnumerate(lpDSEnumCallback: TDSEnumCallback; lpContext: Pointer): HResult; stdcall; external DirectSoundDLL name 'DirectSoundCaptureEnumerateW';
  1955. {$ELSE}
  1956. function DirectSoundCaptureEnumerate(lpDSEnumCallback: TDSEnumCallback; lpContext: Pointer): HResult; stdcall; external DirectSoundDLL name 'DirectSoundCaptureEnumerateA';
  1957. {$ENDIF}
  1958. {$EXTERNALSYM DirectSoundCaptureEnumerate}
  1959. //#if DIRECTSOUND_VERSION >= 0x0800
  1960. function DirectSoundCreate8(pcGuidDevice: PGUID; out ppDS8: IDirectSound8; pUnkOuter: IUnknown): HResult; stdcall; external DirectSoundDLL;
  1961. {$EXTERNALSYM DirectSoundCreate8}
  1962. function DirectSoundCaptureCreate8(pcGuidDevice: PGUID; out ppDSC8: IDirectSoundCapture8; pUnkOuter: IUnknown): HResult; stdcall; external DirectSoundDLL;
  1963. {$EXTERNALSYM DirectSoundCaptureCreate8}
  1964. function DirectSoundFullDuplexCreate(pcGuidCaptureDevice, pcGuidRenderDevice: PGUID;
  1965.   const pcDSCBufferDesc: TDSCBufferDesc; const pcDSBufferDesc: TDSBufferDesc;
  1966.   hWnd: hWnd; dwLevel: DWORD; out ppDSFD: IDirectSoundFullDuplex8;
  1967.   out ppDSCBuffer8: IDirectSoundCaptureBuffer8; out ppDSBuffer8: IDirectSoundBuffer8;
  1968.   pUnkOuter: IUnknown): HResult; stdcall; external DirectSoundDLL;
  1969. {$EXTERNALSYM DirectSoundFullDuplexCreate}
  1970. function DirectSoundFullDuplexCreate8(pcGuidCaptureDevice, pcGuidRenderDevice: PGUID;
  1971.   const pcDSCBufferDesc: TDSCBufferDesc; const pcDSBufferDesc: TDSBufferDesc;
  1972.   hWnd: hWnd; dwLevel: DWORD; out ppDSFD: IDirectSoundFullDuplex8;
  1973.   out ppDSCBuffer8: IDirectSoundCaptureBuffer8; out ppDSBuffer8: IDirectSoundBuffer8;
  1974.   pUnkOuter: IUnknown): HResult; stdcall; external DirectSoundDLL;
  1975. {$EXTERNALSYM DirectSoundFullDuplexCreate8}
  1976. function GetDeviceID(pGuidSrc, pGuidDest: PGUID): HResult; stdcall; external DirectSoundDLL;
  1977. {$EXTERNALSYM GetDeviceID}
  1978. //#endif // DIRECTSOUND_VERSION >= 0x0800
  1979. {$ENDIF}
  1980. implementation
  1981. // #define MAKE_DSHRESULT(code)  MAKE_HRESULT(1, _FACDS, code)
  1982. function MAKE_DSHRESULT(Code: DWord): DWord;
  1983. begin
  1984.   Result:= DWord((1 shl 31) or (_FACDS shl 16)) or Code;
  1985. end;
  1986. // #define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
  1987. function DSSPEAKER_COMBINED(c, g: DWORD): DWORD;
  1988. begin
  1989.   Result:= Byte(c) or (DWORD(Byte(g)) shl 16);
  1990. end;
  1991. // #define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
  1992. function DSSPEAKER_CONFIG(a: Cardinal): Byte;
  1993. begin
  1994.   Result:= Byte(a);
  1995. end;
  1996. // #define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
  1997. function DSSPEAKER_GEOMETRY(a: Cardinal): Byte;
  1998. begin
  1999.   Result:= Byte((DWORD(a) shr 16) and $00FF);
  2000. end;
  2001. {$IFDEF DIRECTSOUND_DYNAMIC_LINK}
  2002. var
  2003.   DirectSoundLib: THandle = 0;
  2004. function DirectSoundLoaded: Boolean;
  2005. begin
  2006.   Result:= (DirectSoundLib <> 0);
  2007. end;
  2008. function UnLoadDirectSound: Boolean;
  2009. begin
  2010.   Result:= True;
  2011.   if (DirectSoundLib <> 0) then
  2012.   begin
  2013.     Result:= Result and FreeLibrary(DirectSoundLib);
  2014.     DirectSoundCreate:= nil;
  2015.     DirectSoundEnumerateW:= nil;
  2016.     DirectSoundEnumerateA:= nil;
  2017.     DirectSoundEnumerate:= nil;
  2018.     DirectSoundCaptureCreate:= nil;
  2019.     DirectSoundCaptureEnumerateW:= nil;
  2020.     DirectSoundCaptureEnumerateA:= nil;
  2021.     DirectSoundCaptureEnumerate:= nil;
  2022.     //#if DIRECTSOUND_VERSION >= 0x0800
  2023.     DirectSoundCreate8:= nil;
  2024.     DirectSoundCaptureCreate8:= nil;
  2025.     DirectSoundFullDuplexCreate:= nil;
  2026.     DirectSoundFullDuplexCreate8:= nil;
  2027.     GetDeviceID:= nil;
  2028.     DirectSoundLib:= 0;
  2029.   end;
  2030. end;
  2031. function LoadDirectSound: Boolean;
  2032. begin
  2033.   Result:= DirectSoundLoaded;
  2034.   if (not Result) then
  2035.   begin
  2036.     DirectSoundLib:= LoadLibrary(DirectSoundDll);
  2037.     if (DirectSoundLib<>0) then
  2038.     begin
  2039.       DirectSoundCreate:= GetProcAddress(DirectSoundLib, 'DirectSoundCreate');
  2040.       DirectSoundEnumerateW:= GetProcAddress(DirectSoundLib, 'DirectSoundEnumerateW');
  2041.       DirectSoundEnumerateA:= GetProcAddress(DirectSoundLib, 'DirectSoundEnumerateA');
  2042.       {$IFDEF UNICODE}
  2043.       DirectSoundEnumerate:= GetProcAddress(DirectSoundLib, 'DirectSoundEnumerateW');
  2044.       {$ELSE}
  2045.       DirectSoundEnumerate:= GetProcAddress(DirectSoundLib, 'DirectSoundEnumerateA');
  2046.       {$ENDIF}
  2047.       DirectSoundCaptureCreate:= GetProcAddress(DirectSoundLib, 'DirectSoundCaptureCreate');
  2048.       DirectSoundCaptureEnumerateW:= GetProcAddress(DirectSoundLib, 'DirectSoundCaptureEnumerateW');
  2049.       DirectSoundCaptureEnumerateA:= GetProcAddress(DirectSoundLib, 'DirectSoundCaptureEnumerateA');
  2050.       {$IFDEF UNICODE}
  2051.       DirectSoundCaptureEnumerate:= GetProcAddress(DirectSoundLib, 'DirectSoundCaptureEnumerateW');
  2052.       {$ELSE}
  2053.       DirectSoundCaptureEnumerate:= GetProcAddress(DirectSoundLib, 'DirectSoundCaptureEnumerateA');
  2054.       {$ENDIF}
  2055.       //#if DIRECTSOUND_VERSION >= 0x0800
  2056.       DirectSoundCreate8:= GetProcAddress(DirectSoundLib, 'DirectSoundCreate8');
  2057.       DirectSoundCaptureCreate8:= GetProcAddress(DirectSoundLib, 'DirectSoundCaptureCreate8');
  2058.       DirectSoundFullDuplexCreate:= GetProcAddress(DirectSoundLib, 'DirectSoundFullDuplexCreate');
  2059.       DirectSoundFullDuplexCreate8:= GetProcAddress(DirectSoundLib, 'DirectSoundFullDuplexCreate');
  2060.       GetDeviceID:= GetProcAddress(DirectSoundLib, 'GetDeviceID');
  2061.       //#endif // DIRECTSOUND_VERSION >= 0x0800
  2062.     end;
  2063.     
  2064.     Result:= Assigned(DirectSoundCreate);
  2065.     if not Result then UnLoadDirectSound;
  2066.   end;
  2067. end;
  2068. {$ELSE}
  2069. function DirectSoundLoaded: Boolean;
  2070. begin // Stub function for static linking
  2071.   Result:= True;
  2072. end;
  2073. function UnLoadDirectSound: Boolean;
  2074. begin // Stub function for static linking
  2075.   Result:= True; // should emulate "normal" behaviour
  2076. end;
  2077. function LoadDirectSound: Boolean;
  2078. begin // Stub function for static linking
  2079.   Result:= True;
  2080. end;
  2081. {$ENDIF}
  2082. {$IFDEF DIRECTSOUND_DYNAMIC_LINK}
  2083. initialization
  2084. {$IFNDEF DIRECTSOUND_DYNAMIC_LINK_EXPLICIT}
  2085.   LoadDirectSound;
  2086. {$ENDIF}
  2087. finalization
  2088.   UnLoadDirectSound;
  2089. {$ENDIF}
  2090. end.