Ada计算机图形DirectX之dsound

----------------------------------------
-- File : dsound.ads                  --
-- Translator:Dongfeng.Gu,2018/10/19  --
-- Mail: [email protected]                --
-- Progress:100%                      --
----------------------------------------

with win32;          use win32;
with win32.rpcdce;   use win32.rpcdce;
with win32.winnt;    use win32.winnt;
with win32.objbase;  use win32.objbase;
with win32.windef;   use win32.windef;
with win32.winerror; 
with win32.mmsystem; use win32.mmsystem;
with interfaces.C;


package dsound is

   DIRECTSOUND_VERSION :constant:=16#0900#;
    
   FLT_MIN:constant:=1.17549e-038;
   FLT_MAX:constant:=3.40282e+038;

   subtype D3DVALUE is float;
   type LPD3DVALUE is access all D3DVALUE;
    
   subtype D3DCOLOR is win32.DWORD;
   type    LPD3DCOLOR is access all D3DCOLOR;
    
   type D3DVECTOR is record
      x:float;
      y:float;
      z:float;
   end record;
   type LPD3DVECTOR is access all D3DVECTOR;
    
   FACDS  :constant:=16#878#;
    
   FUNCTION MAKE_HRESULT(sev, fac, code : WORD) RETURN win32.DWORD;
   function MAKE_DSHRESULT(code:win32.WORD) return win32.DWORD;
   
   -- DirectSound Component GUID {47D4D946-62E8-11CF-93BC-444553540000}
   CLSID_DirectSound:constant win32.rpcdce.GUID:=
     (16#47d4d946#,16#62e8#,16#11cf#,(16#93#,16#bc#,16#44#,16#45#,16#53#,16#54#,16#0#,16#0#));

   -- DirectSound 8.0 Component GUID {3901CC3F-84B5-4FA4-BA35-AA8172B8A09B}
   CLSID_DirectSound8:constant win32.rpcdce.GUID:=
     (16#3901cc3f#,16#84b5#,16#4fa4#,(16#ba#,16#35#,16#aa#,16#81#,16#72#,16#b8#,16#a0#,16#9b#));

   -- DirectSound Capture Component GUID {B0210780-89CD-11D0-AF08-00A0C925CD16}
   CLSID_DirectSoundCapture:constant win32.rpcdce.GUID:=
     (16#b0210780#,16#89cd#,16#11d0#,(16#af#,16#8#,16#0#,16#a0#,16#c9#,16#25#,16#cd#,16#16#));

   -- DirectSound 8.0 Capture Component GUID {E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1}
   CLSID_DirectSoundCapture8:constant win32.rpcdce.GUID:=
     (16#e4bcac13#,16#7f99#,16#4908#,(16#9a#,16#8e#,16#74#,16#e3#,16#bf#,16#24#,16#b6#,16#e1#));

   -- DirectSound Full Duplex Component GUID {FEA4300C-7959-4147-B26A-2377B9E7A91D}
   CLSID_DirectSoundFullDuplex:constant win32.rpcdce.GUID:=
     (16#fea4300c#,16#7959#,16#4147#,(16#b2#,16#6a#,16#23#,16#77#,16#b9#,16#e7#,16#a9#,16#1d#));


   -- DirectSound default playback device GUID {DEF00000-9C6D-47ED-AAF1-4DDA8F2B5C03}
   DSDEVID_DefaultPlayback:constant win32.rpcdce.GUID:=
     (16#def00000#,16#9c6d#,16#47ed#,(16#aa#,16#f1#,16#4d#,16#da#,16#8f#,16#2b#,16#5c#,16#03#));

   -- DirectSound default capture device GUID {DEF00001-9C6D-47ED-AAF1-4DDA8F2B5C03}
   DSDEVID_DefaultCapture:constant win32.rpcdce.GUID:=
     (16#def00001#,16#9c6d#,16#47ed#,(16#aa#,16#f1#,16#4d#,16#da#,16#8f#,16#2b#,16#5c#,16#03#));

   -- DirectSound default device for voice playback {DEF00002-9C6D-47ED-AAF1-4DDA8F2B5C03}
   DSDEVID_DefaultVoicePlayback:constant win32.rpcdce.GUID:=
     (16#def00002#,16#9c6d#,16#47ed#,(16#aa#,16#f1#,16#4d#,16#da#,16#8f#,16#2b#,16#5c#,16#03#));

   -- DirectSound default device for voice capture {DEF00003-9C6D-47ED-AAF1-4DDA8F2B5C03}
   DSDEVID_DefaultVoiceCapture:constant win32.rpcdce.GUID:=
     (16#def00003#,16#9c6d#,16#47ed#,(16#aa#,16#f1#,16#4d#,16#da#,16#8f#,16#2b#,16#5c#,16#03#));
   
   IID_IReferenceClock:constant win32.rpcdce.GUID:= 
     (16#56a86897#,16#0ad4#,16#11ce#,(16#b0#,16#3a#,16#00#,16#20#,16#af#,16#0b#,16#a7#,16#70#));
        
   IID_IDirectSound:constant win32.rpcdce.GUID:=
     (16#279AFA83#,16#4981#,16#11CE#,(16#A5#,16#21#,16#00#,16#20#,16#AF#,16#0B#,16#E5#,16#60#));
        
   IID_IDirectSound8:constant win32.rpcdce.GUID:=
     (16#C50A7E93#,16#F395#,16#4834#,(16#9E#,16#F6#,16#7F#,16#A9#,16#9D#,16#E5#,16#09#,16#66#));
        
   IID_IDirectSoundBuffer:constant win32.rpcdce.GUID:=
     (16#279AFA85#,16#4981#,16#11CE#,(16#A5#,16#21#,16#00#,16#20#,16#AF#,16#0B#,16#E5#,16#60#));
        
   IID_IDirectSoundBuffer8:constant win32.rpcdce.GUID:=
     (16#6825a449#,16#7524#,16#4d82#,(16#92#,16#0f#,16#50#,16#e3#,16#6a#,16#b3#,16#ab#,16#1e#));
        
   IID_IDirectSound3DListener:constant win32.rpcdce.GUID:=
     (16#279AFA84#,16#4981#,16#11CE#,(16#A5#,16#21#,16#00#,16#20#,16#AF#,16#0B#,16#E5#,16#60#));
        
   IID_IDirectSoundCapture:constant win32.rpcdce.GUID:=
     (16#b0210781#,16#89cd#,16#11d0#,(16#af#,16#8#,16#0#,16#a0#,16#c9#,16#25#,16#cd#,16#16#));
        
   IID_IDirectSoundCaptureBuffer:constant win32.rpcdce.GUID:=
     (16#b0210782#,16#89cd#,16#11d0#,(16#af#,16#8#,16#0#,16#a0#,16#c9#,16#25#,16#cd#,16#16#));
        
   IID_IDirectSoundCaptureBuffer8:constant win32.rpcdce.GUID:=
     (16#990df4#,16#dbb#,16#4872#,(16#83#,16#3e#,16#6d#,16#30#,16#3e#,16#80#,16#ae#,16#b6#));
        
   IID_IDirectSoundNotify:constant win32.rpcdce.GUID:=
     (16#b0210783#,16#89cd#,16#11d0#,(16#af#,16#8#,16#0#,16#a0#,16#c9#,16#25#,16#cd#,16#16#));
        
   IID_IKsPropertySet:constant win32.rpcdce.GUID:=
     (16#31efac30#,16#515c#,16#11d0#,(16#a9#,16#aa#,16#00#,16#aa#,16#00#,16#61#,16#be#,16#93#));
        
   IID_IDirectSoundFXGargle:constant win32.rpcdce.GUID:=
     (16#d616f352#,16#d622#,16#11ce#,(16#aa#,16#c5#,16#00#,16#20#,16#af#,16#0b#,16#99#,16#a3#));
        
   IID_IDirectSoundFXChorus:constant win32.rpcdce.GUID:=
     (16#880842e3#,16#145f#,16#43e6#,(16#a9#,16#34#,16#a7#,16#18#,16#06#,16#e5#,16#05#,16#47#));
        
   IID_IDirectSoundFXFlanger:constant win32.rpcdce.GUID:=
     (16#903e9878#,16#2c92#,16#4072#,(16#9b#,16#2c#,16#ea#,16#68#,16#f5#,16#39#,16#67#,16#83#));
        
   IID_IDirectSoundFXEcho:constant win32.rpcdce.GUID:=
     (16#8bd28edf#,16#50db#,16#4e92#,(16#a2#,16#bd#,16#44#,16#54#,16#88#,16#d1#,16#ed#,16#42#));
        
   IID_IDirectSoundFXDistortion:constant win32.rpcdce.GUID:=
     (16#8ecf4326#,16#455f#,16#4d8b#,(16#bd#,16#a9#,16#8d#,16#5d#,16#3e#,16#9e#,16#3e#,16#0b#));
        
   IID_IDirectSoundFXCompressor:constant win32.rpcdce.GUID:=
     (16#4bbd1154#,16#62f6#,16#4e2c#,(16#a1#,16#5c#,16#d3#,16#b6#,16#c4#,16#17#,16#f7#,16#a0#));
        
   IID_IDirectSoundFXParamEq:constant win32.rpcdce.GUID:=
     (16#c03ca9fe#,16#fe90#,16#4204#,(16#80#,16#78#,16#82#,16#33#,16#4c#,16#d1#,16#77#,16#da#));
        
   IID_IDirectSoundFXI3DL2Reverb:constant win32.rpcdce.GUID:=
     (16#4b166a6a#,16#0d66#,16#43f3#,(16#80#,16#e3#,16#ee#,16#62#,16#80#,16#de#,16#e1#,16#a4#));
        
   IID_IDirectSoundFXWavesReverb:constant win32.rpcdce.GUID:=
     (16#46858c3a#,16#0dc6#,16#45e3#,(16#b7#,16#60#,16#d4#,16#ee#,16#f1#,16#6c#,16#b3#,16#25#));
        
   IID_IDirectSoundCaptureFXAec:constant win32.rpcdce.GUID:=
     (16#ad74143d#,16#903d#,16#4ab7#,(16#80#,16#66#,16#28#,16#d3#,16#63#,16#03#,16#6d#,16#65#));
        
   IID_IDirectSoundCaptureFXNoiseSuppress:constant win32.rpcdce.GUID:=
     (16#ed311e41#,16#fbae#,16#4175#,(16#96#,16#25#,16#cd#,16#8#,16#54#,16#f6#,16#93#,16#ca#));
        
   IID_IDirectSoundFullDuplex:constant win32.rpcdce.GUID:=
     (16#edcb4c7a#,16#daab#,16#4216#,(16#a4#,16#2e#,16#6c#,16#50#,16#59#,16#6d#,16#dc#,16#1d#));

   -- No virtualization (Pan3D) {C241333F-1C1B-11d2-94F5-00C04FC28ACA}
   DS3DALG_NO_VIRTUALIZATION:constant win32.rpcdce.GUID:=
     (16#c241333f#,16#1c1b#,16#11d2#,(16#94#,16#f5#,16#0#,16#c0#,16#4f#,16#c2#,16#8a#,16#ca#));

   -- High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA}
   DS3DALG_HRTF_FULL:constant win32.rpcdce.GUID:=
     (16#c2413340#,16#1c1b#,16#11d2#,(16#94#,16#f5#,16#0#,16#c0#,16#4f#,16#c2#,16#8a#,16#ca#));

   -- Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA}
   DS3DALG_HRTF_LIGHT:constant win32.rpcdce.GUID:=
     (16#c2413342#,16#1c1b#,16#11d2#,(16#94#,16#f5#,16#0#,16#c0#,16#4f#,16#c2#,16#8a#,16#ca#));

   -- Gargle {DAFD8210-5711-4B91-9FE3-F75B7AE279BF}
   GUID_DSFX_STANDARD_GARGLE:constant win32.rpcdce.GUID:=
     (16#dafd8210#,16#5711#,16#4b91#,(16#9f#,16#e3#,16#f7#,16#5b#,16#7a#,16#e2#,16#79#,16#bf#));

   -- Chorus {EFE6629C-81F7-4281-BD91-C9D604A95AF6}
   GUID_DSFX_STANDARD_CHORUS:constant win32.rpcdce.GUID:=
     (16#efe6629c#,16#81f7#,16#4281#,(16#bd#,16#91#,16#c9#,16#d6#,16#04#,16#a9#,16#5a#,16#f6#));

   -- Flanger {EFCA3D92-DFD8-4672-A603-7420894BAD98}
   GUID_DSFX_STANDARD_FLANGER:constant win32.rpcdce.GUID:=
     (16#efca3d92#,16#dfd8#,16#4672#,(16#a6#,16#03#,16#74#,16#20#,16#89#,16#4b#,16#ad#,16#98#));

   -- Echo/Delay {EF3E932C-D40B-4F51-8CCF-3F98F1B29D5D}
   GUID_DSFX_STANDARD_ECHO:constant win32.rpcdce.GUID:=
     (16#ef3e932c#,16#d40b#,16#4f51#,(16#8c#,16#cf#,16#3f#,16#98#,16#f1#,16#b2#,16#9d#,16#5d#));

   -- Distortion {EF114C90-CD1D-484E-96E5-09CFAF912A21}
   GUID_DSFX_STANDARD_DISTORTION:constant win32.rpcdce.GUID:=
     (16#ef114c90#,16#cd1d#,16#484e#,(16#96#,16#e5#,16#09#,16#cf#,16#af#,16#91#,16#2a#,16#21#));

   -- Compressor/Limiter {EF011F79-4000-406D-87AF-BFFB3FC39D57}
   GUID_DSFX_STANDARD_COMPRESSOR:constant win32.rpcdce.GUID:=
     (16#ef011f79#,16#4000#,16#406d#,(16#87#,16#af#,16#bf#,16#fb#,16#3f#,16#c3#,16#9d#,16#57#));

   -- Parametric Equalization {120CED89-3BF4-4173-A132-3CB406CF3231}
   GUID_DSFX_STANDARD_PARAMEQ:constant win32.rpcdce.GUID:=
     (16#120ced89#,16#3bf4#,16#4173#,(16#a1#,16#32#,16#3c#,16#b4#,16#06#,16#cf#,16#32#,16#31#));

   -- I3DL2 Environmental Reverberation: Reverb (Listener) Effect {EF985E71-D5C7-42D4-BA4D-2D073E2E96F4}
   GUID_DSFX_STANDARD_I3DL2REVERB:constant win32.rpcdce.GUID:=
     (16#ef985e71#,16#d5c7#,16#42d4#,(16#ba#,16#4d#,16#2d#,16#07#,16#3e#,16#2e#,16#96#,16#f4#));

   -- Waves Reverberation {87FC0268-9A55-4360-95AA-004A1D9DE26C}
   GUID_DSFX_WAVES_REVERB:constant win32.rpcdce.GUID:=
     (16#87fc0268#,16#9a55#,16#4360#,(16#95#,16#aa#,16#00#,16#4a#,16#1d#,16#9d#,16#e2#,16#6c#));

   --
   -- DirectSound Capture Effect Algorithms
   --


   -- Acoustic Echo Canceller {BF963D80-C559-11D0-8A2B-00A0C9255AC1}
   -- Matches KSNODETYPE_ACOUSTIC_ECHO_CANCEL in ksmedia.h
   GUID_DSCFX_CLASS_AEC:constant win32.rpcdce.GUID:=
     (16#BF963D80#,16#C559#,16#11D0#,(16#8A#,16#2B#,16#00#,16#A0#,16#C9#,16#25#,16#5A#,16#C1#));

   -- Microsoft AEC {CDEBB919-379A-488a-8765-F53CFD36DE40}
   GUID_DSCFX_MS_AEC:constant win32.rpcdce.GUID:=
     (16#cdebb919#,16#379a#,16#488a#,(16#87#,16#65#,16#f5#,16#3c#,16#fd#,16#36#,16#de#,16#40#));

   -- System AEC {1C22C56D-9879-4f5b-A389-27996DDC2810}
   GUID_DSCFX_SYSTEM_AEC:constant win32.rpcdce.GUID:=
     (16#1c22c56d#,16#9879#,16#4f5b#,(16#a3#,16#89#,16#27#,16#99#,16#6d#,16#dc#,16#28#,16#10#));

   -- Noise Supression {E07F903F-62FD-4e60-8CDD-DEA7236665B5}
   -- Matches KSNODETYPE_NOISE_SUPPRESS in post Windows ME DDK's ksmedia.h
   GUID_DSCFX_CLASS_NS:constant win32.rpcdce.GUID:=
     (16#e07f903f#,16#62fd#,16#4e60#,(16#8c#,16#dd#,16#de#,16#a7#,16#23#,16#66#,16#65#,16#b5#));

   -- Microsoft Noise Suppresion {11C5C73B-66E9-4ba1-A0BA-E814C6EED92D}
   GUID_DSCFX_MS_NS:constant win32.rpcdce.GUID:=
     (16#11c5c73b#,16#66e9#,16#4ba1#,(16#a0#,16#ba#,16#e8#,16#14#,16#c6#,16#ee#,16#d9#,16#2d#));

   -- System Noise Suppresion {5AB0882E-7274-4516-877D-4EEE99BA4FD0}
   GUID_DSCFX_SYSTEM_NS:constant win32.rpcdce.GUID:=
     (16#5ab0882e#,16#7274#,16#4516#,(16#87#,16#7d#,16#4e#,16#ee#,16#99#,16#ba#,16#4f#,16#d0#));


   --
   -- Interface specification
   --
    
   type IReferenceClock;
   type lpIReferenceClock is access all IReferenceClock;
   subtype lpReferenceClock is lpIReferenceClock;
    
   -- Line:96 Start
   type IDirectSound;
   type lpIDirectSound is access all IDirectSound;
   subtype lpDirectSound is lpIDirectSound;
    
   type IDirectSoundBuffer;
   type lpIDirectSoundBuffer is access all IDirectSoundBuffer;
   subtype lpDirectSoundBuffer is lpIDirectSoundBuffer;
    
   type IDirectSound3DListener;
   type lpIDirectSound3DListener is access all IDirectSound3DListener;
   subtype lpDirectSound3DListener is lpIDirectSound3DListener;
    
   type IDirectSound3DBuffer;
   type lpIDirectSound3DBuffer is access all IDirectSound3DBuffer;
   subtype lpDirectSound3DBuffer is lpIDirectSound3DBuffer;

   type IDirectSoundCapture;
   type lpIDirectSoundCapture is access all IDirectSoundCapture;
   subtype lpDirectSoundCapture is lpIDirectSoundCapture;

   type IDirectSoundCaptureBuffer;
   type lpIDirectSoundCaptureBuffer is access all IDirectSoundCaptureBuffer;
   subtype lpDirectSoundCaptureBuffer is lpIDirectSoundCaptureBuffer;
    
   type IDirectSoundNotify;
   type lpIDirectSoundNotify is access all IDirectSoundNotify;
   subtype lpDirectSoundNotify is lpIDirectSoundNotify;
   -- LINE:102 END
   
   type IDirectSound8;
   type lpIDirectSound8 is access all IDirectSound8;
   subtype lpDirectSound8 is lpIDirectSound8;
   type LPLPDIRECTSOUND8 is access all LPDIRECTSOUND8;
    
   type IDirectSoundBuffer8;
   type lpIDirectSoundBuffer8 is access all IDirectSoundBuffer8;
   subtype lpDirectSoundBuffer8 is lpIDirectSoundBuffer8;
   type LPLPDIRECTSOUNDBUFFER8 is access all LPDIRECTSOUNDBUFFER8;

   subtype IDirectSoundCapture8 is IDirectSoundCapture;
   type LPIDirectSoundCapture8 is access all IDirectSoundCapture8;
   subtype LPDirectSoundCapture8 is LPIDirectSoundCapture8;
   type LPLPDIRECTSOUNDCAPTURE8 is access all LPDIRECTSOUNDCAPTURE8;

    
   type IDirectSoundCaptureBuffer8;
   type lpIDirectSoundCaptureBuffer8 is access all IDirectSoundCaptureBuffer8;
   subtype lpDirectSoundCaptureBuffer8 is lpIDirectSoundCaptureBuffer8;
   type LPLPDIRECTSOUNDCAPTUREBUFFER8 is access all LPDIRECTSOUNDCAPTUREBUFFER8;

   subtype IDirectSound3DListener8 is IDirectSound3DListener;
   type    LPIDirectSound3DListener8 is access all IDirectSound3DListener8;
   subtype LPDirectSound3DListener8 is LPIDirectSound3DListener8;
    

   type IKsPropertySet;
   type lpIKsPropertySet is access all IKsPropertySet;
   subtype lpKsPropertySet is lpIKsPropertySet;

   type IDirectSoundFXGargle;
   type lpIDirectSoundFXGargle is access all IDirectSoundFXGargle;
   subtype lpDirectSoundFXGargle is lpIDirectSoundFXGargle;

   type IDirectSoundFXChorus;
   type lpIDirectSoundFXChorus is access all IDirectSoundFXChorus;
   subtype lpDirectSoundFXChorus is lpIDirectSoundFXChorus;

   type    IDirectSoundFXFlanger;
   type    lpIDirectSoundFXFlanger is access all IDirectSoundFXFlanger;
   subtype lpDirectSoundFXFlanger is lpIDirectSoundFXFlanger;
    
   type IDirectSoundFXEcho;
   type lpIDirectSoundFXEcho is access all IDirectSoundFXEcho;
   subtype lpDirectSoundFXEcho is lpIDirectSoundFXEcho;
    
   type IDirectSoundFXDistortion;
   type lpIDirectSoundFXDistortion is access all IDirectSoundFXDistortion;
   subtype lpDirectSoundFXDistortion is lpIDirectSoundFXDistortion;

   type IDirectSoundFXCompressor;
   type lpIDirectSoundFXCompressor is access all IDirectSoundFXCompressor;
   subtype lpDirectSoundFXCompressor is lpIDirectSoundFXCompressor;

   type IDirectSoundFXParamEq;
   type lpIDirectSoundFXParamEq is access all IDirectSoundFXParamEq;
   subtype lpDirectSoundFXParamEq is lpIDirectSoundFXParamEq;

   type IDirectSoundFXI3DL2Reverb;
   type lpIDirectSoundFXI3DL2Reverb is access all IDirectSoundFXI3DL2Reverb;
   subtype lpDirectSoundFXI3DL2Reverb is lpIDirectSoundFXI3DL2Reverb;

   type IDirectSoundFXWavesReverb;
   type lpIDirectSoundFXWavesReverb is access all IDirectSoundFXWavesReverb;
   subtype lpDirectSoundFXWavesReverb is lpIDirectSoundFXWavesReverb;

   type IDirectSoundCaptureFXAec;
   type lpIDirectSoundCaptureFXAec is access all IDirectSoundCaptureFXAec;
   subtype lpDirectSoundCaptureFXAec is lpIDirectSoundCaptureFXAec;

   type IDirectSoundCaptureFXNoiseSuppress;
   type lpIDirectSoundCaptureFXNoiseSuppress is access all IDirectSoundCaptureFXNoiseSuppress;
   subtype lpDirectSoundCaptureFXNoiseSuppress is lpIDirectSoundCaptureFXNoiseSuppress;

   type IDirectSoundFullDuplex;
   type lpIDirectSoundFullDuplex is access all IDirectSoundFullDuplex;
   subtype lpDirectSoundFullDuplex is lpIDirectSoundFullDuplex;
    

   type LPCGUID is access constant win32.rpcdce.GUID;

   type DSCAPS is record
      dwSize                         :win32.DWORD;
      dwFlags                        :win32.DWORD;
      dwMinSecondarySampleRate       :win32.DWORD;
      dwMaxSecondarySampleRate       :win32.DWORD;
      dwPrimaryBuffers               :win32.DWORD;
      dwMaxHwMixingAllBuffers        :win32.DWORD;
      dwMaxHwMixingStaticBuffers     :win32.DWORD;
      dwMaxHwMixingStreamingBuffers  :win32.DWORD;
      dwFreeHwMixingAllBuffers       :win32.DWORD;
      dwFreeHwMixingStaticBuffers    :win32.DWORD;
      dwFreeHwMixingStreamingBuffers :win32.DWORD;
      dwMaxHw3DAllBuffers            :win32.DWORD;
      dwMaxHw3DStaticBuffers         :win32.DWORD;
      dwMaxHw3DStreamingBuffers      :win32.DWORD;
      dwFreeHw3DAllBuffers           :win32.DWORD;
      dwFreeHw3DStaticBuffers        :win32.DWORD;
      dwFreeHw3DStreamingBuffers     :win32.DWORD;
      dwTotalHwMemBytes              :win32.DWORD;
      dwFreeHwMemBytes               :win32.DWORD;
      dwMaxContigFreeHwMemBytes      :win32.DWORD;
      dwUnlockTransferRateHwBuffers  :win32.DWORD;
      dwPlayCpuOverheadSwBuffers     :win32.DWORD;
      dwReserved1                    :win32.DWORD;
      dwReserved2                    :win32.DWORD;
   end record;
    
   type LPDSCAPS  is access all DSCAPS;
   type LPCDSCAPS is access constant DSCAPS;
    
   type DSBCAPS is record
      dwSize                 :win32.DWORD;
      dwFlags                :win32.DWORD;
      dwBufferBytes          :win32.DWORD;
      dwUnlockTransferRate   :win32.DWORD;
      dwPlayCpuOverhead      :win32.DWORD;
   end record;
   type LPDSBCAPS is access all DSBCAPS;
   type LPCDSBCAPS is access constant DSBCAPS;
    
   type DSEFFECTDESC is record
      dwSize        :win32.DWORD;
      dwFlags       :win32.DWORD;
      guidDSFXClass :win32.rpcdce.GUID;
      dwReserved1   :win32.PDWORD;
      dwReserved2   :win32.PDWORD;
   end record;
   type LPDSEFFECTDESC is access all DSEFFECTDESC;
   type LPCDSEFFECTDESC is access constant DSEFFECTDESC;
    
   DSFX_LOCHARDWARE    :constant:=16#00000001#;
   DSFX_LOCSOFTWARE    :constant:=16#00000002#;
    
   --NON-NAME ENUM
   DSFXR_PRESENT          :constant:=0;
   DSFXR_LOCHARDWARE      :constant:=1;
   DSFXR_LOCSOFTWARE      :constant:=2;
   DSFXR_UNALLOCATED      :constant:=3;
   DSFXR_FAILED           :constant:=4;
   DSFXR_UNKNOWN          :constant:=5;
   DSFXR_SENDLOOP         :constant:=6;
    
   type DSCEFFECTDESC is record
      dwSize             :win32.DWORD;
      dwFlags            :win32.DWORD;
      guidDSCFXClass     :win32.rpcdce.GUID;
      guidDSCFXInstance  :win32.rpcdce.GUID;
      dwReserved1        :win32.DWORD;
      dwReserved2        :win32.DWORD;
   end record;
   type LPDSCEFFECTDESC is access all DSCEFFECTDESC;
   type LPCDSCEFFECTDESC is access constant DSCEFFECTDESC;
    
   DSCFX_LOCHARDWARE   :constant:=16#00000001#;
   DSCFX_LOCSOFTWARE   :constant:=16#00000002#;
   DSCFXR_LOCHARDWARE  :constant:=16#00000010#;
   DSCFXR_LOCSOFTWARE  :constant:=16#00000020#;
    
   type DSBUFFERDESC is record
      dwSize          :win32.DWORD;
      dwFlags         :win32.DWORD;
      dwBufferBytes   :win32.DWORD;
      dwReserved      :win32.DWORD;
      lpwfxFormat     :LPWAVEFORMATEX;
      --DIRECTSOUND_VERSION >= 0x0700
      guid3DAlgorithm :win32.rpcdce.GUID;
   end record;
   type LPDSBUFFERDESC is access all DSBUFFERDESC;
   type LPCDSBUFFERDESC is access constant DSBUFFERDESC;

   --Older version of this structure:
   type DSBUFFERDESC1 is record
      dwSize          :win32.DWORD;
      dwFlags         :win32.DWORD;
      dwBufferBytes   :win32.DWORD;
      dwReserved      :win32.DWORD;
      lpwfxFormat     :LPWAVEFORMATEX;
   end record;
   type LPDSBUFFERDESC1 is access all DSBUFFERDESC1;
   type LPCDSBUFFERDESC1 is access constant DSBUFFERDESC1;
    
   type DS3DBUFFER is record
      dwSize              :win32.DWORD;
      vPosition           :D3DVECTOR  ;
      vVelocity           :D3DVECTOR  ;
      dwInsideConeAngle   :win32.DWORD;
      dwOutsideConeAngle  :win32.DWORD;
      vConeOrientation    :D3DVECTOR  ;
      lConeOutsideVolume  :win32.long ;
      flMinDistance       :D3DVALUE   ;
      flMaxDistance       :D3DVALUE   ;
      dwMode              :win32.DWORD;
   end record;
   type LPDS3DBUFFER is access all DS3DBUFFER;
   type LPCDS3DBUFFER is access constant DS3DBUFFER;
    
   type DS3DLISTENER is record
      dwSize              :win32.DWORD;
      vPosition           :D3DVECTOR  ;
      vVelocity           :D3DVECTOR  ;
      vOrientFront        :D3DVECTOR  ;
      vOrientTop          :D3DVECTOR  ;
      flDistanceFactor    :D3DVALUE   ;
      flRolloffFactor     :D3DVALUE   ;
      flDopplerFactor     :D3DVALUE   ;
   end record;
   type LPDS3DLISTENER is access all DS3DLISTENER;
   type LPCDS3DLISTENER is access constant DS3DLISTENER;
    
   type DSCCAPS is record
      dwSize       :win32.DWORD;
      dwFlags      :win32.DWORD;
      dwFormats    :win32.DWORD;
      dwChannels   :win32.DWORD;
   end record;
   type LPDSCCAPS is access all DSCCAPS;
   type LPCDSCCAPS is access constant DSCCAPS;
    
   type DSCBUFFERDESC1 is record
      dwSize        :win32.DWORD;
      dwFlags       :win32.DWORD;
      dwBufferBytes :win32.DWORD;
      dwReserved    :win32.DWORD;
      lpwfxFormat   :LPWAVEFORMATEX; --in MMSYSTEM
   end record;
   type LPDSCBUFFERDESC1 is access all DSCBUFFERDESC1;
    
   type DSCBUFFERDESC is record
      dwSize        :win32.DWORD;
      dwFlags       :win32.DWORD;
      dwBufferBytes :win32.DWORD;
      dwReserved    :win32.DWORD;
      lpwfxFormat   :LPWAVEFORMATEX; --in MMSYSTEM
      dwFXCount     :win32.DWORD;
      lpDSCFXDesc   :LPDSCEFFECTDESC;
   end record;
   type LPDSCBUFFERDESC is access all DSCBUFFERDESC;
   type LPCDSCBUFFERDESC is access constant DSCBUFFERDESC;
    
   type DSCBCAPS is record
      dwSize        :win32.DWORD;
      dwFlags       :win32.DWORD;
      dwBufferBytes :win32.DWORD;
      dwReserved    :win32.DWORD;
   end record;
   type LPDSCBCAPS is access all DSCBCAPS;
   type LPCDSCBCAPS is access constant DSCBCAPS;
    
   type DSBPOSITIONNOTIFY is record
      dwOffset       :win32.DWORD;
      hEventNotify   :win32.winnt.HANDLE;
   end record;
   type LPDSBPOSITIONNOTIFY is access all DSBPOSITIONNOTIFY;
   type LPCDSBPOSITIONNOTIFY is access constant DSBPOSITIONNOTIFY;
    
   type DSFXGargle is record
      dwRateHz   :DWORD;            -- Rate of modulation in hz
      dwWaveShape:DWORD;            -- DSFXGARGLE_WAVE_xxx
   end record;
   type LPDSFXGargle is access all DSFXGargle;
   type LPCDSFXGargle is access constant DSFXGargle;
    
   DSFXGARGLE_WAVE_TRIANGLE        :constant:=0;
   DSFXGARGLE_WAVE_SQUARE          :constant:=1;
   DSFXGARGLE_RATEHZ_MIN           :constant:=1;
   DSFXGARGLE_RATEHZ_MAX           :constant:=1000;
    
   type DSFXChorus is record
      fWetDryMix    :float;
      fDepth        :float;
      fFeedback     :float;
      fFrequency    :float;
      lWaveform     :LONG;          -- LFO shape; DSFXCHORUS_WAVE_xxx
      fDelay        :float;
      lPhase        :long;
   end record;
   type LPDSFXChorus is access all DSFXChorus;
   type LPCDSFXChorus is access constant DSFXChorus;
    
   DSFXFLANGER_WAVE_TRIANGLE       :constant:=0;
   DSFXFLANGER_WAVE_SIN            :constant:=1;

   DSFXFLANGER_WETDRYMIX_MIN       :constant:=0.0;
   DSFXFLANGER_WETDRYMIX_MAX       :constant:=100.0;
   DSFXFLANGER_FREQUENCY_MIN       :constant:=0.0;
   DSFXFLANGER_FREQUENCY_MAX       :constant:=10.0;
   DSFXFLANGER_DEPTH_MIN           :constant:=0.0;
   DSFXFLANGER_DEPTH_MAX           :constant:=100.0;
   DSFXFLANGER_PHASE_MIN           :constant:=0;
   DSFXFLANGER_PHASE_MAX           :constant:=4;
   DSFXFLANGER_FEEDBACK_MIN        :constant:=-99.0;
   DSFXFLANGER_FEEDBACK_MAX        :constant:=99.0;
   DSFXFLANGER_DELAY_MIN           :constant:=0.0;
   DSFXFLANGER_DELAY_MAX           :constant:=4.0;

   DSFXFLANGER_PHASE_NEG_180       :constant:=0;
   DSFXFLANGER_PHASE_NEG_90        :constant:=1;
   DSFXFLANGER_PHASE_ZERO          :constant:=2;
   DSFXFLANGER_PHASE_90            :constant:=3;
   DSFXFLANGER_PHASE_180           :constant:=4;

   type DSFXEcho is record
      fWetDryMix   :float;
      fFeedback    :float;
      fLeftDelay   :float;
      fRightDelay  :float;
      lPanDelay    :float;
   end record;
   type LPDSFXEcho is access all DSFXEcho;
   type LPCDSFXEcho is access constant DSFXEcho;
    
   DSFXECHO_WETDRYMIX_MIN      :constant:=0.0;
   DSFXECHO_WETDRYMIX_MAX      :constant:=100.0;
   DSFXECHO_FEEDBACK_MIN       :constant:=0.0;
   DSFXECHO_FEEDBACK_MAX       :constant:=100.0;
   DSFXECHO_LEFTDELAY_MIN      :constant:=1.0;
   DSFXECHO_LEFTDELAY_MAX      :constant:=2000.0;
   DSFXECHO_RIGHTDELAY_MIN     :constant:=1.0;
   DSFXECHO_RIGHTDELAY_MAX     :constant:=2000.0;
   DSFXECHO_PANDELAY_MIN       :constant:=0;
   DSFXECHO_PANDELAY_MAX       :constant:=1;

   type DSFXDistortion is record
      fGain                    :float;
      fEdge                    :float;
      fPostEQCenterFrequency   :float;
      fPostEQBandwidth         :float;
      fPreLowpassCutoff        :float;
   end record;
   type LPDSFXDistortion is access all DSFXDistortion;
   type LPCDSFXDistortion is access constant DSFXDistortion;
    
   DSFXDISTORTION_GAIN_MIN                     :constant:=-60.0;
   DSFXDISTORTION_GAIN_MAX                     :constant:=0.0;
   DSFXDISTORTION_EDGE_MIN                     :constant:=0.0;
   DSFXDISTORTION_EDGE_MAX                     :constant:=100.0;
   DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN    :constant:=100.0;
   DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX    :constant:=8000.0;
   DSFXDISTORTION_POSTEQBANDWIDTH_MIN          :constant:=100.0;
   DSFXDISTORTION_POSTEQBANDWIDTH_MAX          :constant:=8000.0;
   DSFXDISTORTION_PRELOWPASSCUTOFF_MIN         :constant:=100.0;
   DSFXDISTORTION_PRELOWPASSCUTOFF_MAX         :constant:=8000.0;
    
   type DSFXCompressor is record
      fGain        :float;
      fAttack      :float;
      fRelease     :float;
      fThreshold   :float;
      fRatio       :float;
      fPredelay    :float;
   end record;
   type LPDSFXCompressor is access all DSFXCompressor;
   type LPCDSFXCompressor is access constant DSFXCompressor;
    
   DSFXCOMPRESSOR_GAIN_MIN             :constant:=-60.0;
   DSFXCOMPRESSOR_GAIN_MAX             :constant:=60.0;
   DSFXCOMPRESSOR_ATTACK_MIN           :constant:=0.01;
   DSFXCOMPRESSOR_ATTACK_MAX           :constant:=500.0;
   DSFXCOMPRESSOR_RELEASE_MIN          :constant:=50.0;
   DSFXCOMPRESSOR_RELEASE_MAX          :constant:=3000.0;
   DSFXCOMPRESSOR_THRESHOLD_MIN        :constant:=-60.0;
   DSFXCOMPRESSOR_THRESHOLD_MAX        :constant:=0.0;
   DSFXCOMPRESSOR_RATIO_MIN            :constant:=1.0;
   DSFXCOMPRESSOR_RATIO_MAX            :constant:=100.0;
   DSFXCOMPRESSOR_PREDELAY_MIN         :constant:=0.0;
   DSFXCOMPRESSOR_PREDELAY_MAX         :constant:=4.0;
    
   type DSFXParamEq is record
      fCenter     :float;
      fBandwidth  :float;
      fGain       :float;
   end record;
   type LPDSFXParamEq  is access all DSFXParamEq;
   type LPCDSFXParamEq is access constant DSFXParamEq;
    
   DSFXPARAMEQ_CENTER_MIN      :constant:=80.0;
   DSFXPARAMEQ_CENTER_MAX      :constant:=16000.0;
   DSFXPARAMEQ_BANDWIDTH_MIN   :constant:=1.0;
   DSFXPARAMEQ_BANDWIDTH_MAX   :constant:=36.0;
   DSFXPARAMEQ_GAIN_MIN        :constant:=-15.0;
   DSFXPARAMEQ_GAIN_MAX        :constant:=15.0;
    
   type DSFXI3DL2Reverb is record
      lRoom               :long;     -- [-10000, 0]      default: -1000 mB
      lRoomHF             :long;     -- [-10000, 0]      default: 0 mB
      flRoomRolloffFactor :float;    -- [0.0, 10.0]      default: 0.0
      flDecayTime         :float;    -- [0.1, 20.0]      default: 1.49s
      flDecayHFRatio      :float;    -- [0.1, 2.0]       default: 0.83
      lReflections        :long;     -- [-10000, 1000]   default: -2602 mB
      flReflectionsDelay  :float;    -- [0.0, 0.3]       default: 0.007 s
      lReverb             :long;     -- [-10000, 2000]   default: 200 mB
      flReverbDelay       :float;    -- [0.0, 0.1]       default: 0.011 s
      flDiffusion         :float;    -- [0.0, 100.0]     default: 100.0 %
      flDensity           :float;    -- [0.0, 100.0]     default: 100.0 %
      flHFReference       :float;    -- [20.0, 20000.0]  default: 5000.0 Hz
   end record;
   type LPDSFXI3DL2Reverb is access all DSFXI3DL2Reverb;
   type LPCDSFXI3DL2Reverb is access constant DSFXI3DL2Reverb;
    
   DSFX_I3DL2REVERB_ROOM_MIN                   :constant:=(-10000);
   DSFX_I3DL2REVERB_ROOM_MAX                   :constant:=0;
   DSFX_I3DL2REVERB_ROOM_DEFAULT               :constant:=(-1000);

   DSFX_I3DL2REVERB_ROOMHF_MIN                 :constant:=(-10000);
   DSFX_I3DL2REVERB_ROOMHF_MAX                 :constant:=0;
   DSFX_I3DL2REVERB_ROOMHF_DEFAULT             :constant:=(-100);

   DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN      :constant:=0.0;
   DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX      :constant:=10.0;
   DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT  :constant:=0.0;

   DSFX_I3DL2REVERB_DECAYTIME_MIN              :constant:=0.1;
   DSFX_I3DL2REVERB_DECAYTIME_MAX              :constant:=20.0;
   DSFX_I3DL2REVERB_DECAYTIME_DEFAULT          :constant:=1.49;

   DSFX_I3DL2REVERB_DECAYHFRATIO_MIN           :constant:=0.1;
   DSFX_I3DL2REVERB_DECAYHFRATIO_MAX           :constant:=2.0;
   DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT       :constant:=0.83;

   DSFX_I3DL2REVERB_REFLECTIONS_MIN            :constant:=(-10000);
   DSFX_I3DL2REVERB_REFLECTIONS_MAX            :constant:=1000;
   DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT        :constant:=(-2602);

   DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN       :constant:=0.0;
   DSFX_I3DL2REVERB_REFLECTIONSDELAY_MAX       :constant:=0.3;
   DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT   :constant:=0.007;

   DSFX_I3DL2REVERB_REVERB_MIN                 :constant:=(-10000);
   DSFX_I3DL2REVERB_REVERB_MAX                 :constant:=2000;
   DSFX_I3DL2REVERB_REVERB_DEFAULT             :constant:=(200);

   DSFX_I3DL2REVERB_REVERBDELAY_MIN            :constant:=0.0;
   DSFX_I3DL2REVERB_REVERBDELAY_MAX            :constant:=0.1;
   DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT        :constant:=0.011;

   DSFX_I3DL2REVERB_DIFFUSION_MIN              :constant:=0.0;
   DSFX_I3DL2REVERB_DIFFUSION_MAX              :constant:=100.0;
   DSFX_I3DL2REVERB_DIFFUSION_DEFAULT          :constant:=100.0;

   DSFX_I3DL2REVERB_DENSITY_MIN                :constant:=0.0;
   DSFX_I3DL2REVERB_DENSITY_MAX                :constant:=100.0;
   DSFX_I3DL2REVERB_DENSITY_DEFAULT            :constant:=100.0;

   DSFX_I3DL2REVERB_HFREFERENCE_MIN            :constant:=20.0;
   DSFX_I3DL2REVERB_HFREFERENCE_MAX            :constant:=20000.0;
   DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT        :constant:=5000.0;

   DSFX_I3DL2REVERB_QUALITY_MIN                :constant:=0;
   DSFX_I3DL2REVERB_QUALITY_MAX                :constant:=3;
   DSFX_I3DL2REVERB_QUALITY_DEFAULT            :constant:=2;
    
   type DSFXWavesReverb is record
      fInGain         :float;                -- [-96.0,0.0]            default: 0.0 dB
      fReverbMix      :FLOAT;                -- [-96.0,0.0]            default: 0.0 db
      fReverbTime     :FLOAT;                -- [0.001,3000.0]         default: 1000.0 ms
      fHighFreqRTRatio:FLOAT;                -- [0.001,0.999]          default: 0.001
   end record;
   type LPDSFXWavesReverb  is access all DSFXWavesReverb;
   type LPCDSFXWavesReverb is access constant DSFXWavesReverb;
    
   DSFX_WAVESREVERB_INGAIN_MIN                 :constant:=-96.0;
   DSFX_WAVESREVERB_INGAIN_MAX                 :constant:=0.0;
   DSFX_WAVESREVERB_INGAIN_DEFAULT             :constant:=0.0;
   DSFX_WAVESREVERB_REVERBMIX_MIN              :constant:=-96.0;
   DSFX_WAVESREVERB_REVERBMIX_MAX              :constant:=0.0;
   DSFX_WAVESREVERB_REVERBMIX_DEFAULT          :constant:=0.0;
   DSFX_WAVESREVERB_REVERBTIME_MIN             :constant:=0.001;
   DSFX_WAVESREVERB_REVERBTIME_MAX             :constant:=3000.0;
   DSFX_WAVESREVERB_REVERBTIME_DEFAULT         :constant:=1000.0;
   DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN        :constant:=0.001;
   DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX        :constant:=0.999;
   DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT    :constant:=0.001;
    
    
   type DSCFXAec is record
      fEnable    :win32.BOOL;
      fNoiseFill :win32.BOOL;
      dwMode     :win32.DWORD;
   end record;
   type LPDSCFXAec  is access all DSCFXAec;
   type LPCDSCFXAec is access constant DSCFXAec;
    
   DSCFX_AEC_MODE_PASS_THROUGH                     :constant:=16#0#;
   DSCFX_AEC_MODE_HALF_DUPLEX                      :constant:=16#1#;
   DSCFX_AEC_MODE_FULL_DUPLEX                      :constant:=16#2#;
   DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED          :constant:=16#0#;
   DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED :constant:=16#1#;
   DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED    :constant:=16#2#;
   DSCFX_AEC_STATUS_CURRENTLY_CONVERGED            :constant:=16#8#;

   type DSCFXNoiseSuppress is record
      fEnable:win32.BOOL;
   end record;
   type LPDSCFXNoiseSuppress is access all DSCFXNoiseSuppress;
   type LPCDSCFXNoiseSuppress is access constant DSCFXNoiseSuppress;
    
   type DSFXFlanger is record
      fWetDryMix   :float;
      fDepth       :float;
      fFeedback    :float;
      fFrequency   :float;
      lWaveform    :long;
      fDelay       :float;
      lPhase       :long;
   end record;
   type LPDSFXFlanger is access all DSFXFlanger;
   type LPCDSFXFlanger is access constant DSFXFlanger;
    
    
    
   --
   -- DirectSound API
   --
   type LPGUID is access all win32.rpcdce.GUID;
    
   type LPDSENUMCALLBACKA is access function
     (pGuid             :LPGUID; 
      lpcstrDescription :LPCSTR;
      lpcstrModule      :LPCSTR;
      lpContext         :win32.LPVOID
     ) return win32.BOOL;
   pragma convention(stdcall,LPDSENUMCALLBACKA);
    
   type LPDSENUMCALLBACKW is access function
     (pGuid             :LPGUID; 
      lpcstrDescription :LPCWSTR;
      lpcstrModule      :LPCWSTR;
      lpContext         :win32.LPVOID
     ) return win32.BOOL;
   pragma convention(stdcall,LPDSENUMCALLBACKW);
    
   function DirectSoundCreate
     (pcGuidDevice:LPCGUID;
      ppDS        :LPDirectSound; 
      pUnkOuter   :LPUnknown) return win32.objbase.HResult;
   pragma import(stdcall,DirectSoundCreate,"DirectSoundCreate");
    
   function DirectSoundEnumerateA
     (pDSEnumCallback :LPDSENUMCALLBACKA ;
      pContext        :win32.LPVOID) return win32.objbase.HResult;
   pragma import(stdcall,DirectSoundEnumerateA,"DirectSoundEnumerateA");
     
   function DirectSoundEnumerateW
     (pDSEnumCallback :LPDSENUMCALLBACKW ;
      pContext        :win32.LPVOID) return win32.objbase.HResult;
   pragma import(stdcall,DirectSoundEnumerateW,"DirectSoundEnumerateW");
    
   function DirectSoundCaptureCreate
     (pcGuidDevice : LPCGUID ;
      ppDSC        : access LPDIRECTSOUNDCAPTURE ;
      pUnkOuter    : LPUNKNOWN) return HResult;
   pragma import(stdcall,DirectSoundCaptureCreate,"DirectSoundCaptureCreate");
            
   function DirectSoundCaptureEnumerateA
     (pDSEnumCallback :LPDSENUMCALLBACKA ;
      pContext        :win32.LPVOID) return HResult;
   pragma import(stdcall,DirectSoundCaptureEnumerateA,"DirectSoundCaptureEnumerateA");
    
   function DirectSoundCaptureEnumerateW
     (pDSEnumCallback :LPDSENUMCALLBACKW ;
      pContext        :win32.LPVOID) return HResult;
   pragma import(stdcall,DirectSoundCaptureEnumerateW,"DirectSoundCaptureEnumerateW");
    
   function DirectSoundCreate8
     (pcGuidDevice :LPCGUID ;
      ppDS8        :access LPDIRECTSOUND8; 
      pUnkOuter    :LPUNKNOWN) return HResult;
   pragma import(stdcall,DirectSoundCreate8,"DirectSoundCreate8");
    
   function DirectSoundCaptureCreate8
     (pcGuidDevice :LPCGUID ;
      ppDSC8       :access LPDIRECTSOUNDCAPTURE8 ; 
      pUnkOuter    :LPUNKNOWN) return HResult;
   pragma import(stdcall,DirectSoundCaptureCreate8,"DirectSoundCaptureCreate8");
    
   function DirectSoundFullDuplexCreate
     (pcGuidCaptureDevice   :LPCGUID ;
      pcGuidRenderDevice    :LPCGUID ;
      pcDSCBufferDesc       :LPCDSCBUFFERDESC ;
      pcDSBufferDesc        :LPCDSBUFFERDESC ;
      hWd                   :HWND ;
      dwLevel               :DWORD ; 
      ppDSFD                :access LPDIRECTSOUNDFULLDUPLEX ; 
      ppDSCBuffer8          :access LPDIRECTSOUNDCAPTUREBUFFER8 ;
      ppDSBuffer8           :access LPDIRECTSOUNDBUFFER8 ; 
      pUnkOuter             :LPUNKNOWN ) return HResult;
   pragma import(stdcall,DirectSoundFullDuplexCreate,"DirectSoundFullDuplexCreate");    
    
   function DirectSoundFullDuplexCreate8
     (pcGuidCaptureDevice   :LPCGUID ;
      pcGuidRenderDevice    :LPCGUID ;
      pcDSCBufferDesc       :LPCDSCBUFFERDESC ;
      pcDSBufferDesc        :LPCDSBUFFERDESC ;
      hWd                   :HWND ;
      dwLevel               :DWORD ; 
      ppDSFD                :access LPDIRECTSOUNDFULLDUPLEX ; 
      ppDSCBuffer8          :access LPDIRECTSOUNDCAPTUREBUFFER8 ;
      ppDSBuffer8           :access LPDIRECTSOUNDBUFFER8 ; 
      pUnkOuter             :LPUNKNOWN ) return HResult;
   pragma import(stdcall,DirectSoundFullDuplexCreate8,"DirectSoundFullDuplexCreate");   
    
   function GetDeviceID(pGuidSrc :LPCGUID; pGuidDest :LPGUID) return HResult;
   pragma import(stdcall,GetDeviceID,"GetDeviceID");
    

            
   subtype REFERENCE_TIME is win32.LONGLONG;
   type LPREFERENCE_TIME is access all REFERENCE_TIME;
    
    
    
    
   ----------------
   -- Interfaces --
   ----------------
    
   --IReferenceClock
    
   type af_IReferenceClock_QueryInterface is access procedure(THIS:access IReferenceClock;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IReferenceClock_QueryInterface);

   type af_IReferenceClock_AddRef is access function(THIS:access IReferenceClock) return ULONG;
   pragma convention(stdcall, af_IReferenceClock_AddRef);

   type af_IReferenceClock_Release is access function(THIS:access IReferenceClock) return ULONG;
   pragma convention(stdcall, af_IReferenceClock_Release);

   type af_IReferenceClock_GetTime is access procedure(THIS:access IReferenceClock;pTime:access REFERENCE_TIME);
   pragma convention(stdcall, af_IReferenceClock_GetTime);

   type af_IReferenceClock_AdviseTime is access procedure(THIS:access IReferenceClock;rtBaseTime:REFERENCE_TIME;rtStreamTime:REFERENCE_TIME;hEvent:HANDLE;pdwAdviseCookie:LPDWORD);
   pragma convention(stdcall, af_IReferenceClock_AdviseTime);

   type af_IReferenceClock_AdvisePeriodic is access procedure(THIS:access IReferenceClock;rtStartTime:REFERENCE_TIME;rtPeriodTime:REFERENCE_TIME;hSemaphore:HANDLE;pdwAdviseCookie:LPDWORD);
   pragma convention(stdcall, af_IReferenceClock_AdvisePeriodic);

   type af_IReferenceClock_Unadvise is access procedure(THIS:access IReferenceClock;dwAdviseCookie:DWORD);
   pragma convention(stdcall, af_IReferenceClock_Unadvise);

   type IReferenceClock_vtbl is record
      QueryInterface      :af_IReferenceClock_QueryInterface;
      AddRef      :af_IReferenceClock_AddRef;
      Release      :af_IReferenceClock_Release;
      GetTime      :af_IReferenceClock_GetTime;
      AdviseTime      :af_IReferenceClock_AdviseTime;
      AdvisePeriodic      :af_IReferenceClock_AdvisePeriodic;
      Unadvise      :af_IReferenceClock_Unadvise;
   end record;
   pragma convention(C_PASS_BY_COPY,IReferenceClock_vtbl);

   type lpIReferenceClock_vtbl is access all IReferenceClock_vtbl;
   type IReferenceClock is record
      vtbl:lpIReferenceClock_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IReferenceClock);

    
   --IDirectSound
    
   type af_IDirectSound_QueryInterface is access procedure(THIS:access IDirectSound;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSound_QueryInterface);

   type af_IDirectSound_AddRef is access function(THIS:access IDirectSound) return ULONG;
   pragma convention(stdcall, af_IDirectSound_AddRef);

   type af_IDirectSound_Release is access function(THIS:access IDirectSound) return ULONG;
   pragma convention(stdcall, af_IDirectSound_Release);

   type af_IDirectSound_CreateSoundBuffer is access procedure(THIS:access IDirectSound;pcDSBufferDesc:LPCDSBUFFERDESC;ppDSBuffer:access LPDIRECTSOUNDBUFFER;pUnkOuter:LPUNKNOWN);
   pragma convention(stdcall, af_IDirectSound_CreateSoundBuffer);

   type af_IDirectSound_GetCaps is access procedure(THIS:access IDirectSound;pDSCaps:LPDSCAPS);
   pragma convention(stdcall, af_IDirectSound_GetCaps);

   type af_IDirectSound_DuplicateSoundBuffer is access procedure(THIS:access IDirectSound;pDSBufferOriginal:LPDIRECTSOUNDBUFFER;ppDSBufferDuplicate:access LPDIRECTSOUNDBUFFER);
   pragma convention(stdcall, af_IDirectSound_DuplicateSoundBuffer);

   type af_IDirectSound_SetCooperativeLevel is access procedure(THIS:access IDirectSound;hw:HWND;dwLevel:DWORD);
   pragma convention(stdcall, af_IDirectSound_SetCooperativeLevel);

   type af_IDirectSound_Compact is access procedure(THIS:access IDirectSound);
   pragma convention(stdcall, af_IDirectSound_Compact);

   type af_IDirectSound_GetSpeakerConfig is access procedure(THIS:access IDirectSound;pdwSpeakerConfig:LPDWORD);
   pragma convention(stdcall, af_IDirectSound_GetSpeakerConfig);

   type af_IDirectSound_SetSpeakerConfig is access procedure(THIS:access IDirectSound;dwSpeakerConfig:DWORD);
   pragma convention(stdcall, af_IDirectSound_SetSpeakerConfig);

   type af_IDirectSound_Initialize is access procedure(THIS:access IDirectSound;pcGuidDevice:LPCGUID);
   pragma convention(stdcall, af_IDirectSound_Initialize);

   type IDirectSound_vtbl is record
      QueryInterface      :af_IDirectSound_QueryInterface;
      AddRef      :af_IDirectSound_AddRef;
      Release      :af_IDirectSound_Release;
      CreateSoundBuffer      :af_IDirectSound_CreateSoundBuffer;
      GetCaps      :af_IDirectSound_GetCaps;
      DuplicateSoundBuffer      :af_IDirectSound_DuplicateSoundBuffer;
      SetCooperativeLevel      :af_IDirectSound_SetCooperativeLevel;
      Compact      :af_IDirectSound_Compact;
      GetSpeakerConfig      :af_IDirectSound_GetSpeakerConfig;
      SetSpeakerConfig      :af_IDirectSound_SetSpeakerConfig;
      Initialize      :af_IDirectSound_Initialize;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSound_vtbl);

   type lpIDirectSound_vtbl is access all IDirectSound_vtbl;
   type IDirectSound is record
      vtbl:lpIDirectSound_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSound);

    
   --IDirectSound8
    
   type af_IDirectSound8_QueryInterface is access procedure(THIS:access IDirectSound8;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSound8_QueryInterface);

   type af_IDirectSound8_AddRef is access function(THIS:access IDirectSound8) return ULONG;
   pragma convention(stdcall, af_IDirectSound8_AddRef);

   type af_IDirectSound8_Release is access function(THIS:access IDirectSound8) return ULONG;
   pragma convention(stdcall, af_IDirectSound8_Release);

   type af_IDirectSound8_CreateSoundBuffer is access procedure(THIS:access IDirectSound8;pcDSBufferDesc:LPCDSBUFFERDESC;ppDSBuffer:access LPDIRECTSOUNDBUFFER;pUnkOuter:LPUNKNOWN);
   pragma convention(stdcall, af_IDirectSound8_CreateSoundBuffer);

   type af_IDirectSound8_GetCaps is access procedure(THIS:access IDirectSound8;pDSCaps:LPDSCAPS);
   pragma convention(stdcall, af_IDirectSound8_GetCaps);

   type af_IDirectSound8_DuplicateSoundBuffer is access procedure(THIS:access IDirectSound8;pDSBufferOriginal:LPDIRECTSOUNDBUFFER;ppDSBufferDuplicate:access LPDIRECTSOUNDBUFFER);
   pragma convention(stdcall, af_IDirectSound8_DuplicateSoundBuffer);

   type af_IDirectSound8_SetCooperativeLevel is access procedure(THIS:access IDirectSound8;hw:HWND;dwLevel:DWORD);
   pragma convention(stdcall, af_IDirectSound8_SetCooperativeLevel);

   type af_IDirectSound8_Compact is access procedure(THIS:access IDirectSound8);
   pragma convention(stdcall, af_IDirectSound8_Compact);

   type af_IDirectSound8_GetSpeakerConfig is access procedure(THIS:access IDirectSound8;pdwSpeakerConfig:LPDWORD);
   pragma convention(stdcall, af_IDirectSound8_GetSpeakerConfig);

   type af_IDirectSound8_SetSpeakerConfig is access procedure(THIS:access IDirectSound8;dwSpeakerConfig:DWORD);
   pragma convention(stdcall, af_IDirectSound8_SetSpeakerConfig);

   type af_IDirectSound8_Initialize is access procedure(THIS:access IDirectSound8;pcGuidDevice:LPCGUID);
   pragma convention(stdcall, af_IDirectSound8_Initialize);

   type af_IDirectSound8_VerifyCertification is access procedure(THIS:access IDirectSound8;pdwCertified:LPDWORD);
   pragma convention(stdcall, af_IDirectSound8_VerifyCertification);

   type IDirectSound8_vtbl is record
      QueryInterface      :af_IDirectSound8_QueryInterface;
      AddRef      :af_IDirectSound8_AddRef;
      Release      :af_IDirectSound8_Release;
      CreateSoundBuffer      :af_IDirectSound8_CreateSoundBuffer;
      GetCaps      :af_IDirectSound8_GetCaps;
      DuplicateSoundBuffer      :af_IDirectSound8_DuplicateSoundBuffer;
      SetCooperativeLevel      :af_IDirectSound8_SetCooperativeLevel;
      Compact      :af_IDirectSound8_Compact;
      GetSpeakerConfig      :af_IDirectSound8_GetSpeakerConfig;
      SetSpeakerConfig      :af_IDirectSound8_SetSpeakerConfig;
      Initialize      :af_IDirectSound8_Initialize;
      VerifyCertification      :af_IDirectSound8_VerifyCertification;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSound8_vtbl);

   type lpIDirectSound8_vtbl is access all IDirectSound8_vtbl;
   type IDirectSound8 is record
      vtbl:lpIDirectSound8_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSound8);
    
   --
   -- Interface: IDirectSoundBuffer
   --
    
   type af_IDirectSoundBuffer_QueryInterface is access procedure(THIS:access IDirectSoundBuffer;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundBuffer_QueryInterface);

   type af_IDirectSoundBuffer_AddRef is access function(THIS:access IDirectSoundBuffer) return ULONG;
   pragma convention(stdcall, af_IDirectSoundBuffer_AddRef);

   type af_IDirectSoundBuffer_Release is access function(THIS:access IDirectSoundBuffer) return ULONG;
   pragma convention(stdcall, af_IDirectSoundBuffer_Release);

   type af_IDirectSoundBuffer_GetCaps is access procedure(THIS:access IDirectSoundBuffer;pDSBufferCaps:LPDSBCAPS);
   pragma convention(stdcall, af_IDirectSoundBuffer_GetCaps);

   type af_IDirectSoundBuffer_GetCurrentPosition is access procedure(THIS:access IDirectSoundBuffer;pdwCurrentPlayCursor:LPDWORD;pdwCurrentWriteCursor:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer_GetCurrentPosition);

   type af_IDirectSoundBuffer_GetFormat is access procedure(THIS:access IDirectSoundBuffer;pwfxFormat:LPWAVEFORMATEX;dwSizeAllocated:DWORD;pdwSizeWritten:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer_GetFormat);

   type af_IDirectSoundBuffer_GetVolume is access procedure(THIS:access IDirectSoundBuffer;plVolume:LPLONG);
   pragma convention(stdcall, af_IDirectSoundBuffer_GetVolume);

   type af_IDirectSoundBuffer_GetPan is access procedure(THIS:access IDirectSoundBuffer;plPan:LPLONG);
   pragma convention(stdcall, af_IDirectSoundBuffer_GetPan);

   type af_IDirectSoundBuffer_GetFrequency is access procedure(THIS:access IDirectSoundBuffer;pdwFrequency:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer_GetFrequency);

   type af_IDirectSoundBuffer_GetStatus is access procedure(THIS:access IDirectSoundBuffer;pdwStatus:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer_GetStatus);

   type af_IDirectSoundBuffer_Initialize is access procedure(THIS:access IDirectSoundBuffer;pDirectSound:LPDIRECTSOUND;pcDSBufferDesc:LPCDSBUFFERDESC);
   pragma convention(stdcall, af_IDirectSoundBuffer_Initialize);

   type af_IDirectSoundBuffer_Lock is access procedure(THIS:access IDirectSoundBuffer;dwOffset:DWORD;dwBytes:DWORD;ppvAudioPtr1:access LPVOID;pdwAudioBytes1:LPDWORD;ppvAudioPtr2:access LPVOID;pdwAudioBytes2:LPDWORD;dwFlags:DWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer_Lock);

   type af_IDirectSoundBuffer_Play is access procedure(THIS:access IDirectSoundBuffer;dwReserved1:DWORD;dwPriority:DWORD;dwFlags:DWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer_Play);

   type af_IDirectSoundBuffer_SetCurrentPosition is access procedure(THIS:access IDirectSoundBuffer;dwNewPosition:DWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer_SetCurrentPosition);

   type af_IDirectSoundBuffer_SetFormat is access procedure(THIS:access IDirectSoundBuffer;pcfxFormat:LPCWAVEFORMATEX);
   pragma convention(stdcall, af_IDirectSoundBuffer_SetFormat);

   type af_IDirectSoundBuffer_SetVolume is access procedure(THIS:access IDirectSoundBuffer;lVolume:LONG);
   pragma convention(stdcall, af_IDirectSoundBuffer_SetVolume);

   type af_IDirectSoundBuffer_SetPan is access procedure(THIS:access IDirectSoundBuffer;lPan:LONG);
   pragma convention(stdcall, af_IDirectSoundBuffer_SetPan);

   type af_IDirectSoundBuffer_SetFrequency is access procedure(THIS:access IDirectSoundBuffer;dwFrequency:DWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer_SetFrequency);

   type af_IDirectSoundBuffer_Stop is access procedure(THIS:access IDirectSoundBuffer);
   pragma convention(stdcall, af_IDirectSoundBuffer_Stop);

   type af_IDirectSoundBuffer_Unlock is access procedure(THIS:access IDirectSoundBuffer;pvAudioPtr1:LPVOID;dwAudioBytes1:DWORD;pvAudioPtr2:LPVOID;dwAudioBytes2:DWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer_Unlock);

   type af_IDirectSoundBuffer_Restore is access procedure(THIS:access IDirectSoundBuffer);
   pragma convention(stdcall, af_IDirectSoundBuffer_Restore);

   type IDirectSoundBuffer_vtbl is record
      QueryInterface      :af_IDirectSoundBuffer_QueryInterface;
      AddRef      :af_IDirectSoundBuffer_AddRef;
      Release      :af_IDirectSoundBuffer_Release;
      GetCaps      :af_IDirectSoundBuffer_GetCaps;
      GetCurrentPosition      :af_IDirectSoundBuffer_GetCurrentPosition;
      GetFormat      :af_IDirectSoundBuffer_GetFormat;
      GetVolume      :af_IDirectSoundBuffer_GetVolume;
      GetPan      :af_IDirectSoundBuffer_GetPan;
      GetFrequency      :af_IDirectSoundBuffer_GetFrequency;
      GetStatus      :af_IDirectSoundBuffer_GetStatus;
      Initialize      :af_IDirectSoundBuffer_Initialize;
      Lock      :af_IDirectSoundBuffer_Lock;
      Play      :af_IDirectSoundBuffer_Play;
      SetCurrentPosition      :af_IDirectSoundBuffer_SetCurrentPosition;
      SetFormat      :af_IDirectSoundBuffer_SetFormat;
      SetVolume      :af_IDirectSoundBuffer_SetVolume;
      SetPan      :af_IDirectSoundBuffer_SetPan;
      SetFrequency      :af_IDirectSoundBuffer_SetFrequency;
      Stop      :af_IDirectSoundBuffer_Stop;
      Unlock      :af_IDirectSoundBuffer_Unlock;
      Restore      :af_IDirectSoundBuffer_Restore;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundBuffer_vtbl);

   type lpIDirectSoundBuffer_vtbl is access all IDirectSoundBuffer_vtbl;
   type IDirectSoundBuffer is record
      vtbl:lpIDirectSoundBuffer_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundBuffer);
    
    
   --
   -- interface: IDirectSoundBuffer8
   --
    
   type af_IDirectSoundBuffer8_QueryInterface is access procedure(THIS:access IDirectSoundBuffer8;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundBuffer8_QueryInterface);

   type af_IDirectSoundBuffer8_AddRef is access function(THIS:access IDirectSoundBuffer8) return ULONG;
   pragma convention(stdcall, af_IDirectSoundBuffer8_AddRef);

   type af_IDirectSoundBuffer8_Release is access function(THIS:access IDirectSoundBuffer8) return ULONG;
   pragma convention(stdcall, af_IDirectSoundBuffer8_Release);

   type af_IDirectSoundBuffer8_GetCaps is access procedure(THIS:access IDirectSoundBuffer8;pDSBufferCaps:LPDSBCAPS);
   pragma convention(stdcall, af_IDirectSoundBuffer8_GetCaps);

   type af_IDirectSoundBuffer8_GetCurrentPosition is access procedure(THIS:access IDirectSoundBuffer8;pdwCurrentPlayCursor:LPDWORD;pdwCurrentWriteCursor:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer8_GetCurrentPosition);

   type af_IDirectSoundBuffer8_GetFormat is access procedure(THIS:access IDirectSoundBuffer8;pwfxFormat:LPWAVEFORMATEX;dwSizeAllocated:DWORD;pdwSizeWritten:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer8_GetFormat);

   type af_IDirectSoundBuffer8_GetVolume is access procedure(THIS:access IDirectSoundBuffer8;plVolume:LPLONG);
   pragma convention(stdcall, af_IDirectSoundBuffer8_GetVolume);

   type af_IDirectSoundBuffer8_GetPan is access procedure(THIS:access IDirectSoundBuffer8;plPan:LPLONG);
   pragma convention(stdcall, af_IDirectSoundBuffer8_GetPan);

   type af_IDirectSoundBuffer8_GetFrequency is access procedure(THIS:access IDirectSoundBuffer8;pdwFrequency:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer8_GetFrequency);

   type af_IDirectSoundBuffer8_GetStatus is access procedure(THIS:access IDirectSoundBuffer8;pdwStatus:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer8_GetStatus);

   type af_IDirectSoundBuffer8_Initialize is access procedure(THIS:access IDirectSoundBuffer8;pDirectSound:LPDIRECTSOUND;pcDSBufferDesc:LPCDSBUFFERDESC);
   pragma convention(stdcall, af_IDirectSoundBuffer8_Initialize);

   type af_IDirectSoundBuffer8_Lock is access procedure(THIS:access IDirectSoundBuffer8;dwOffset:DWORD;dwBytes:DWORD;ppvAudioPtr1:access LPVOID;pdwAudioBytes1:LPDWORD;ppvAudioPtr2:access LPVOID;pdwAudioBytes2:LPDWORD;dwFlags:DWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer8_Lock);

   type af_IDirectSoundBuffer8_Play is access procedure(THIS:access IDirectSoundBuffer8;dwReserved1:DWORD;dwPriority:DWORD;dwFlags:DWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer8_Play);

   type af_IDirectSoundBuffer8_SetCurrentPosition is access procedure(THIS:access IDirectSoundBuffer8;dwNewPosition:DWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer8_SetCurrentPosition);

   type af_IDirectSoundBuffer8_SetFormat is access procedure(THIS:access IDirectSoundBuffer8;pcfxFormat:LPCWAVEFORMATEX);
   pragma convention(stdcall, af_IDirectSoundBuffer8_SetFormat);

   type af_IDirectSoundBuffer8_SetVolume is access procedure(THIS:access IDirectSoundBuffer8;lVolume:LONG);
   pragma convention(stdcall, af_IDirectSoundBuffer8_SetVolume);

   type af_IDirectSoundBuffer8_SetPan is access procedure(THIS:access IDirectSoundBuffer8;lPan:LONG);
   pragma convention(stdcall, af_IDirectSoundBuffer8_SetPan);

   type af_IDirectSoundBuffer8_SetFrequency is access procedure(THIS:access IDirectSoundBuffer8;dwFrequency:DWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer8_SetFrequency);

   type af_IDirectSoundBuffer8_Stop is access procedure(THIS:access IDirectSoundBuffer8);
   pragma convention(stdcall, af_IDirectSoundBuffer8_Stop);

   type af_IDirectSoundBuffer8_Unlock is access procedure(THIS:access IDirectSoundBuffer8;pvAudioPtr1:LPVOID;dwAudioBytes1:DWORD;pvAudioPtr2:LPVOID;dwAudioBytes2:DWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer8_Unlock);

   type af_IDirectSoundBuffer8_Restore is access procedure(THIS:access IDirectSoundBuffer8);
   pragma convention(stdcall, af_IDirectSoundBuffer8_Restore);

   type af_IDirectSoundBuffer8_SetFX is access procedure(THIS:access IDirectSoundBuffer8;dwEffectsCount:DWORD;pDSFXDesc:LPDSEFFECTDESC;pdwResultCodes:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer8_SetFX);

   type af_IDirectSoundBuffer8_AcquireResources is access procedure(THIS:access IDirectSoundBuffer8;dwFlags:DWORD;dwEffectsCount:DWORD;pdwResultCodes:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundBuffer8_AcquireResources);

   type af_IDirectSoundBuffer8_GetObjectInPath is access procedure(THIS:access IDirectSoundBuffer8;rguidObject:REFGUID;dwIndex:DWORD;rguidInterface:REFGUID;ppObject:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundBuffer8_GetObjectInPath);

   type IDirectSoundBuffer8_vtbl is record
      QueryInterface      :af_IDirectSoundBuffer8_QueryInterface;
      AddRef      :af_IDirectSoundBuffer8_AddRef;
      Release      :af_IDirectSoundBuffer8_Release;
      GetCaps      :af_IDirectSoundBuffer8_GetCaps;
      GetCurrentPosition      :af_IDirectSoundBuffer8_GetCurrentPosition;
      GetFormat      :af_IDirectSoundBuffer8_GetFormat;
      GetVolume      :af_IDirectSoundBuffer8_GetVolume;
      GetPan      :af_IDirectSoundBuffer8_GetPan;
      GetFrequency      :af_IDirectSoundBuffer8_GetFrequency;
      GetStatus      :af_IDirectSoundBuffer8_GetStatus;
      Initialize      :af_IDirectSoundBuffer8_Initialize;
      Lock      :af_IDirectSoundBuffer8_Lock;
      Play      :af_IDirectSoundBuffer8_Play;
      SetCurrentPosition      :af_IDirectSoundBuffer8_SetCurrentPosition;
      SetFormat      :af_IDirectSoundBuffer8_SetFormat;
      SetVolume      :af_IDirectSoundBuffer8_SetVolume;
      SetPan      :af_IDirectSoundBuffer8_SetPan;
      SetFrequency      :af_IDirectSoundBuffer8_SetFrequency;
      Stop      :af_IDirectSoundBuffer8_Stop;
      Unlock      :af_IDirectSoundBuffer8_Unlock;
      Restore      :af_IDirectSoundBuffer8_Restore;
      SetFX      :af_IDirectSoundBuffer8_SetFX;
      AcquireResources      :af_IDirectSoundBuffer8_AcquireResources;
      GetObjectInPath      :af_IDirectSoundBuffer8_GetObjectInPath;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundBuffer8_vtbl);

   type lpIDirectSoundBuffer8_vtbl is access all IDirectSoundBuffer8_vtbl;
   type IDirectSoundBuffer8 is record
      vtbl:lpIDirectSoundBuffer8_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundBuffer8);

    
   --
   -- Interface: IDirectSound3DListener
   --
    
   type af_IDirectSound3DListener_QueryInterface is access procedure(THIS:access IDirectSound3DListener;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSound3DListener_QueryInterface);

   type af_IDirectSound3DListener_AddRef is access function(THIS:access IDirectSound3DListener) return ULONG;
   pragma convention(stdcall, af_IDirectSound3DListener_AddRef);

   type af_IDirectSound3DListener_Release is access function(THIS:access IDirectSound3DListener) return ULONG;
   pragma convention(stdcall, af_IDirectSound3DListener_Release);

   type af_IDirectSound3DListener_GetAllParameters is access procedure(THIS:access IDirectSound3DListener;pListener:LPDS3DLISTENER);
   pragma convention(stdcall, af_IDirectSound3DListener_GetAllParameters);

   type af_IDirectSound3DListener_GetDistanceFactor is access procedure(THIS:access IDirectSound3DListener;pflDistanceFactor:access D3DVALUE);
   pragma convention(stdcall, af_IDirectSound3DListener_GetDistanceFactor);

   type af_IDirectSound3DListener_GetDopplerFactor is access procedure(THIS:access IDirectSound3DListener;pflDopplerFactor:access D3DVALUE);
   pragma convention(stdcall, af_IDirectSound3DListener_GetDopplerFactor);

   type af_IDirectSound3DListener_GetOrientation is access procedure(THIS:access IDirectSound3DListener;pvOrientFront:access D3DVECTOR;pvOrientTop:access D3DVECTOR);
   pragma convention(stdcall, af_IDirectSound3DListener_GetOrientation);

   type af_IDirectSound3DListener_GetPosition is access procedure(THIS:access IDirectSound3DListener;pvPosition:access D3DVECTOR);
   pragma convention(stdcall, af_IDirectSound3DListener_GetPosition);

   type af_IDirectSound3DListener_GetRolloffFactor is access procedure(THIS:access IDirectSound3DListener;pflRolloffFactor:access D3DVALUE);
   pragma convention(stdcall, af_IDirectSound3DListener_GetRolloffFactor);

   type af_IDirectSound3DListener_GetVelocity is access procedure(THIS:access IDirectSound3DListener;pvVelocity:access D3DVECTOR);
   pragma convention(stdcall, af_IDirectSound3DListener_GetVelocity);

   type af_IDirectSound3DListener_SetAllParameters is access procedure(THIS:access IDirectSound3DListener;pcListener:LPCDS3DLISTENER;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DListener_SetAllParameters);

   type af_IDirectSound3DListener_SetDistanceFactor is access procedure(THIS:access IDirectSound3DListener;flDistanceFactor:D3DVALUE;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DListener_SetDistanceFactor);

   type af_IDirectSound3DListener_SetDopplerFactor is access procedure(THIS:access IDirectSound3DListener;flDopplerFactor:D3DVALUE;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DListener_SetDopplerFactor);

   type af_IDirectSound3DListener_SetOrientation is access procedure(THIS:access IDirectSound3DListener;xFront:D3DVALUE;yFront:D3DVALUE;zFront:D3DVALUE;xTop:D3DVALUE;yTop:D3DVALUE;zTop:D3DVALUE;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DListener_SetOrientation);

   type af_IDirectSound3DListener_SetPosition is access procedure(THIS:access IDirectSound3DListener;x:D3DVALUE;y:D3DVALUE;z:D3DVALUE;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DListener_SetPosition);

   type af_IDirectSound3DListener_SetRolloffFactor is access procedure(THIS:access IDirectSound3DListener;flRolloffFactor:D3DVALUE;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DListener_SetRolloffFactor);

   type af_IDirectSound3DListener_SetVelocity is access procedure(THIS:access IDirectSound3DListener;x:D3DVALUE;y:D3DVALUE;z:D3DVALUE;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DListener_SetVelocity);

   type af_IDirectSound3DListener_CommitDeferredSettings is access procedure(THIS:access IDirectSound3DListener);
   pragma convention(stdcall, af_IDirectSound3DListener_CommitDeferredSettings);

   type IDirectSound3DListener_vtbl is record
      QueryInterface              :af_IDirectSound3DListener_QueryInterface;
      AddRef                      :af_IDirectSound3DListener_AddRef;
      Release                     :af_IDirectSound3DListener_Release;
      GetAllParameters            :af_IDirectSound3DListener_GetAllParameters;
      GetDistanceFactor           :af_IDirectSound3DListener_GetDistanceFactor;
      GetDopplerFactor            :af_IDirectSound3DListener_GetDopplerFactor;
      GetOrientation              :af_IDirectSound3DListener_GetOrientation;
      GetPosition                 :af_IDirectSound3DListener_GetPosition;
      GetRolloffFactor            :af_IDirectSound3DListener_GetRolloffFactor;
      GetVelocity                 :af_IDirectSound3DListener_GetVelocity;
      SetAllParameters            :af_IDirectSound3DListener_SetAllParameters;
      SetDistanceFactor           :af_IDirectSound3DListener_SetDistanceFactor;
      SetDopplerFactor            :af_IDirectSound3DListener_SetDopplerFactor;
      SetOrientation              :af_IDirectSound3DListener_SetOrientation;
      SetPosition                 :af_IDirectSound3DListener_SetPosition;
      SetRolloffFactor            :af_IDirectSound3DListener_SetRolloffFactor;
      SetVelocity                 :af_IDirectSound3DListener_SetVelocity;
      CommitDeferredSettings      :af_IDirectSound3DListener_CommitDeferredSettings;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSound3DListener_vtbl);

   type lpIDirectSound3DListener_vtbl is access all IDirectSound3DListener_vtbl;
   type IDirectSound3DListener is record
      vtbl:lpIDirectSound3DListener_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSound3DListener);

    
   --
   -- Interface: IDirectSound3DBuffer
   --
    
   type af_IDirectSound3DBuffer_QueryInterface is access procedure(THIS:access IDirectSound3DBuffer;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSound3DBuffer_QueryInterface);

   type af_IDirectSound3DBuffer_AddRef is access function(THIS:access IDirectSound3DBuffer) return ULONG;
   pragma convention(stdcall, af_IDirectSound3DBuffer_AddRef);

   type af_IDirectSound3DBuffer_Release is access function(THIS:access IDirectSound3DBuffer) return ULONG;
   pragma convention(stdcall, af_IDirectSound3DBuffer_Release);

   type af_IDirectSound3DBuffer_GetAllParameters is access procedure(THIS:access IDirectSound3DBuffer;pDs3dBuffer:LPDS3DBUFFER);
   pragma convention(stdcall, af_IDirectSound3DBuffer_GetAllParameters);

   type af_IDirectSound3DBuffer_GetConeAngles is access procedure(THIS:access IDirectSound3DBuffer;pdwInsideConeAngle:LPDWORD;pdwOutsideConeAngle:LPDWORD);
   pragma convention(stdcall, af_IDirectSound3DBuffer_GetConeAngles);

   type af_IDirectSound3DBuffer_GetConeOrientation is access procedure(THIS:access IDirectSound3DBuffer;pvOrientation:access D3DVECTOR);
   pragma convention(stdcall, af_IDirectSound3DBuffer_GetConeOrientation);

   type af_IDirectSound3DBuffer_GetConeOutsideVolume is access procedure(THIS:access IDirectSound3DBuffer;plConeOutsideVolume:LPLONG);
   pragma convention(stdcall, af_IDirectSound3DBuffer_GetConeOutsideVolume);

   type af_IDirectSound3DBuffer_GetMaxDistance is access procedure(THIS:access IDirectSound3DBuffer;pflMaxDistance:access D3DVALUE);
   pragma convention(stdcall, af_IDirectSound3DBuffer_GetMaxDistance);

   type af_IDirectSound3DBuffer_GetMinDistance is access procedure(THIS:access IDirectSound3DBuffer;pflMinDistance:access D3DVALUE);
   pragma convention(stdcall, af_IDirectSound3DBuffer_GetMinDistance);

   type af_IDirectSound3DBuffer_GetMode is access procedure(THIS:access IDirectSound3DBuffer;pdwMode:LPDWORD);
   pragma convention(stdcall, af_IDirectSound3DBuffer_GetMode);

   type af_IDirectSound3DBuffer_GetPosition is access procedure(THIS:access IDirectSound3DBuffer;pvPosition:access D3DVECTOR);
   pragma convention(stdcall, af_IDirectSound3DBuffer_GetPosition);

   type af_IDirectSound3DBuffer_GetVelocity is access procedure(THIS:access IDirectSound3DBuffer;pvVelocity:access D3DVECTOR);
   pragma convention(stdcall, af_IDirectSound3DBuffer_GetVelocity);

   type af_IDirectSound3DBuffer_SetAllParameters is access procedure(THIS:access IDirectSound3DBuffer;pcDs3dBuffer:LPCDS3DBUFFER;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DBuffer_SetAllParameters);

   type af_IDirectSound3DBuffer_SetConeAngles is access procedure(THIS:access IDirectSound3DBuffer;dwInsideConeAngle:DWORD;dwOutsideConeAngle:DWORD;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DBuffer_SetConeAngles);

   type af_IDirectSound3DBuffer_SetConeOrientation is access procedure(THIS:access IDirectSound3DBuffer;x:D3DVALUE;y:D3DVALUE;z:D3DVALUE;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DBuffer_SetConeOrientation);

   type af_IDirectSound3DBuffer_SetConeOutsideVolume is access procedure(THIS:access IDirectSound3DBuffer;lConeOutsideVolume:LONG;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DBuffer_SetConeOutsideVolume);

   type af_IDirectSound3DBuffer_SetMaxDistance is access procedure(THIS:access IDirectSound3DBuffer;flMaxDistance:D3DVALUE;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DBuffer_SetMaxDistance);

   type af_IDirectSound3DBuffer_SetMinDistance is access procedure(THIS:access IDirectSound3DBuffer;flMinDistance:D3DVALUE;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DBuffer_SetMinDistance);

   type af_IDirectSound3DBuffer_SetMode is access procedure(THIS:access IDirectSound3DBuffer;dwMode:DWORD;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DBuffer_SetMode);

   type af_IDirectSound3DBuffer_SetPosition is access procedure(THIS:access IDirectSound3DBuffer;x:D3DVALUE;y:D3DVALUE;z:D3DVALUE;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DBuffer_SetPosition);

   type af_IDirectSound3DBuffer_SetVelocity is access procedure(THIS:access IDirectSound3DBuffer;x:D3DVALUE;y:D3DVALUE;z:D3DVALUE;dwApply:DWORD);
   pragma convention(stdcall, af_IDirectSound3DBuffer_SetVelocity);

   type IDirectSound3DBuffer_vtbl is record
      QueryInterface            :af_IDirectSound3DBuffer_QueryInterface;
      AddRef                    :af_IDirectSound3DBuffer_AddRef;
      Release                   :af_IDirectSound3DBuffer_Release;
      GetAllParameters          :af_IDirectSound3DBuffer_GetAllParameters;
      GetConeAngles             :af_IDirectSound3DBuffer_GetConeAngles;
      GetConeOrientation        :af_IDirectSound3DBuffer_GetConeOrientation;
      GetConeOutsideVolume      :af_IDirectSound3DBuffer_GetConeOutsideVolume;
      GetMaxDistance            :af_IDirectSound3DBuffer_GetMaxDistance;
      GetMinDistance            :af_IDirectSound3DBuffer_GetMinDistance;
      GetMode                   :af_IDirectSound3DBuffer_GetMode;
      GetPosition               :af_IDirectSound3DBuffer_GetPosition;
      GetVelocity               :af_IDirectSound3DBuffer_GetVelocity;
      SetAllParameters          :af_IDirectSound3DBuffer_SetAllParameters;
      SetConeAngles             :af_IDirectSound3DBuffer_SetConeAngles;
      SetConeOrientation        :af_IDirectSound3DBuffer_SetConeOrientation;
      SetConeOutsideVolume      :af_IDirectSound3DBuffer_SetConeOutsideVolume;
      SetMaxDistance            :af_IDirectSound3DBuffer_SetMaxDistance;
      SetMinDistance            :af_IDirectSound3DBuffer_SetMinDistance;
      SetMode                   :af_IDirectSound3DBuffer_SetMode;
      SetPosition               :af_IDirectSound3DBuffer_SetPosition;
      SetVelocity               :af_IDirectSound3DBuffer_SetVelocity;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSound3DBuffer_vtbl);

   type lpIDirectSound3DBuffer_vtbl is access all IDirectSound3DBuffer_vtbl;
   type IDirectSound3DBuffer is record
      vtbl:lpIDirectSound3DBuffer_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSound3DBuffer);

    
    
   --
   -- Interface: IDirectSoundCapture
   --
    
   type af_IDirectSoundCapture_QueryInterface is access procedure(THIS:access IDirectSoundCapture;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundCapture_QueryInterface);

   type af_IDirectSoundCapture_AddRef is access function(THIS:access IDirectSoundCapture) return ULONG;
   pragma convention(stdcall, af_IDirectSoundCapture_AddRef);

   type af_IDirectSoundCapture_Release is access function(THIS:access IDirectSoundCapture) return ULONG;
   pragma convention(stdcall, af_IDirectSoundCapture_Release);

   type af_IDirectSoundCapture_CreateCaptureBuffer is access procedure(THIS:access IDirectSoundCapture;pcDSCBufferDesc:LPCDSCBUFFERDESC;ppDSCBuffer:access LPDIRECTSOUNDCAPTUREBUFFER;pUnkOuter:LPUNKNOWN);
   pragma convention(stdcall, af_IDirectSoundCapture_CreateCaptureBuffer);

   type af_IDirectSoundCapture_GetCaps is access procedure(THIS:access IDirectSoundCapture;pDSCCaps:LPDSCCAPS);
   pragma convention(stdcall, af_IDirectSoundCapture_GetCaps);

   type af_IDirectSoundCapture_Initialize is access procedure(THIS:access IDirectSoundCapture;pcGuidDevice:LPCGUID);
   pragma convention(stdcall, af_IDirectSoundCapture_Initialize);

   type IDirectSoundCapture_vtbl is record
      QueryInterface           :af_IDirectSoundCapture_QueryInterface;
      AddRef                   :af_IDirectSoundCapture_AddRef;
      Release                  :af_IDirectSoundCapture_Release;
      CreateCaptureBuffer      :af_IDirectSoundCapture_CreateCaptureBuffer;
      GetCaps                  :af_IDirectSoundCapture_GetCaps;
      Initialize               :af_IDirectSoundCapture_Initialize;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundCapture_vtbl);

   type lpIDirectSoundCapture_vtbl is access all IDirectSoundCapture_vtbl;
   type IDirectSoundCapture is record
      vtbl:lpIDirectSoundCapture_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundCapture);
    
    
   --
   -- Interface: IDirectSoundCaptureBuffer
   --
    
   type af_IDirectSoundCaptureBuffer_QueryInterface is access procedure(THIS:access IDirectSoundCaptureBuffer;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_QueryInterface);

   type af_IDirectSoundCaptureBuffer_AddRef is access function(THIS:access IDirectSoundCaptureBuffer) return ULONG;
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_AddRef);

   type af_IDirectSoundCaptureBuffer_Release is access function(THIS:access IDirectSoundCaptureBuffer) return ULONG;
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_Release);

   type af_IDirectSoundCaptureBuffer_GetCaps is access procedure(THIS:access IDirectSoundCaptureBuffer;pDSCBCaps:LPDSCBCAPS);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_GetCaps);

   type af_IDirectSoundCaptureBuffer_GetCurrentPosition is access procedure(THIS:access IDirectSoundCaptureBuffer;pdwCapturePosition:LPDWORD;pdwReadPosition:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_GetCurrentPosition);

   type af_IDirectSoundCaptureBuffer_GetFormat is access procedure(THIS:access IDirectSoundCaptureBuffer;pwfxFormat:LPWAVEFORMATEX;dwSizeAllocated:DWORD;pdwSizeWritten:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_GetFormat);

   type af_IDirectSoundCaptureBuffer_GetStatus is access procedure(THIS:access IDirectSoundCaptureBuffer;pdwStatus:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_GetStatus);

   type af_IDirectSoundCaptureBuffer_Initialize is access procedure(THIS:access IDirectSoundCaptureBuffer;pDirectSoundCapture:LPDIRECTSOUNDCAPTURE;pcDSCBufferDesc:LPCDSCBUFFERDESC);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_Initialize);

   type af_IDirectSoundCaptureBuffer_Lock is access procedure(THIS:access IDirectSoundCaptureBuffer;dwOffset:DWORD;dwBytes:DWORD;ppvAudioPtr1:access LPVOID;pdwAudioBytes1:LPDWORD;ppvAudioPtr2:access LPVOID;pdwAudioBytes2:LPDWORD;dwFlags:DWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_Lock);

   type af_IDirectSoundCaptureBuffer_Start is access procedure(THIS:access IDirectSoundCaptureBuffer;dwFlags:DWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_Start);

   type af_IDirectSoundCaptureBuffer_Stop is access procedure(THIS:access IDirectSoundCaptureBuffer);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_Stop);

   type af_IDirectSoundCaptureBuffer_Unlock is access procedure(THIS:access IDirectSoundCaptureBuffer;pvAudioPtr1:LPVOID;dwAudioBytes1:DWORD;pvAudioPtr2:LPVOID;dwAudioBytes2:DWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer_Unlock);

   type IDirectSoundCaptureBuffer_vtbl is record
      QueryInterface      :af_IDirectSoundCaptureBuffer_QueryInterface;
      AddRef      :af_IDirectSoundCaptureBuffer_AddRef;
      Release      :af_IDirectSoundCaptureBuffer_Release;
      GetCaps      :af_IDirectSoundCaptureBuffer_GetCaps;
      GetCurrentPosition      :af_IDirectSoundCaptureBuffer_GetCurrentPosition;
      GetFormat      :af_IDirectSoundCaptureBuffer_GetFormat;
      GetStatus      :af_IDirectSoundCaptureBuffer_GetStatus;
      Initialize      :af_IDirectSoundCaptureBuffer_Initialize;
      Lock      :af_IDirectSoundCaptureBuffer_Lock;
      Start      :af_IDirectSoundCaptureBuffer_Start;
      Stop      :af_IDirectSoundCaptureBuffer_Stop;
      Unlock      :af_IDirectSoundCaptureBuffer_Unlock;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundCaptureBuffer_vtbl);

   type lpIDirectSoundCaptureBuffer_vtbl is access all IDirectSoundCaptureBuffer_vtbl;
   type IDirectSoundCaptureBuffer is record
      vtbl:lpIDirectSoundCaptureBuffer_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundCaptureBuffer);
    
   --
   -- Interface: IDirectSoundCaptureBuffer8
   --
    
   type af_IDirectSoundCaptureBuffer8_QueryInterface is access procedure(THIS:access IDirectSoundCaptureBuffer8;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_QueryInterface);

   type af_IDirectSoundCaptureBuffer8_AddRef is access function(THIS:access IDirectSoundCaptureBuffer8) return ULONG;
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_AddRef);

   type af_IDirectSoundCaptureBuffer8_Release is access function(THIS:access IDirectSoundCaptureBuffer8) return ULONG;
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_Release);

   type af_IDirectSoundCaptureBuffer8_GetCaps is access procedure(THIS:access IDirectSoundCaptureBuffer8;pDSCBCaps:LPDSCBCAPS);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_GetCaps);

   type af_IDirectSoundCaptureBuffer8_GetCurrentPosition is access procedure(THIS:access IDirectSoundCaptureBuffer8;pdwCapturePosition:LPDWORD;pdwReadPosition:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_GetCurrentPosition);

   type af_IDirectSoundCaptureBuffer8_GetFormat is access procedure(THIS:access IDirectSoundCaptureBuffer8;pwfxFormat:LPWAVEFORMATEX;dwSizeAllocated:DWORD;pdwSizeWritten:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_GetFormat);

   type af_IDirectSoundCaptureBuffer8_GetStatus is access procedure(THIS:access IDirectSoundCaptureBuffer8;pdwStatus:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_GetStatus);

   type af_IDirectSoundCaptureBuffer8_Initialize is access procedure(THIS:access IDirectSoundCaptureBuffer8;pDirectSoundCapture:LPDIRECTSOUNDCAPTURE;pcDSCBufferDesc:LPCDSCBUFFERDESC);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_Initialize);

   type af_IDirectSoundCaptureBuffer8_Lock is access procedure(THIS:access IDirectSoundCaptureBuffer8;dwOffset:DWORD;dwBytes:DWORD;ppvAudioPtr1:access LPVOID;pdwAudioBytes1:LPDWORD;ppvAudioPtr2:access LPVOID;pdwAudioBytes2:LPDWORD;dwFlags:DWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_Lock);

   type af_IDirectSoundCaptureBuffer8_Start is access procedure(THIS:access IDirectSoundCaptureBuffer8;dwFlags:DWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_Start);

   type af_IDirectSoundCaptureBuffer8_Stop is access procedure(THIS:access IDirectSoundCaptureBuffer8);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_Stop);

   type af_IDirectSoundCaptureBuffer8_Unlock is access procedure(THIS:access IDirectSoundCaptureBuffer8;pvAudioPtr1:LPVOID;dwAudioBytes1:DWORD;pvAudioPtr2:LPVOID;dwAudioBytes2:DWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_Unlock);

   type af_IDirectSoundCaptureBuffer8_GetObjectInPath is access procedure(THIS:access IDirectSoundCaptureBuffer8;rguidObject:REFGUID;dwIndex:DWORD;rguidInterface:REFGUID;ppObject:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_GetObjectInPath);

   type af_IDirectSoundCaptureBuffer8_GetFXStatus is access procedure(THIS:access IDirectSoundCaptureBuffer8);
   pragma convention(stdcall, af_IDirectSoundCaptureBuffer8_GetFXStatus);

   type IDirectSoundCaptureBuffer8_vtbl is record
      QueryInterface        :af_IDirectSoundCaptureBuffer8_QueryInterface;
      AddRef                :af_IDirectSoundCaptureBuffer8_AddRef;
      Release               :af_IDirectSoundCaptureBuffer8_Release;
      GetCaps               :af_IDirectSoundCaptureBuffer8_GetCaps;
      GetCurrentPosition    :af_IDirectSoundCaptureBuffer8_GetCurrentPosition;
      GetFormat             :af_IDirectSoundCaptureBuffer8_GetFormat;
      GetStatus             :af_IDirectSoundCaptureBuffer8_GetStatus;
      Initialize            :af_IDirectSoundCaptureBuffer8_Initialize;
      Lock                  :af_IDirectSoundCaptureBuffer8_Lock;
      Start                 :af_IDirectSoundCaptureBuffer8_Start;
      Stop                  :af_IDirectSoundCaptureBuffer8_Stop;
      Unlock                :af_IDirectSoundCaptureBuffer8_Unlock;
      GetObjectInPath       :af_IDirectSoundCaptureBuffer8_GetObjectInPath;
      GetFXStatus           :af_IDirectSoundCaptureBuffer8_GetFXStatus;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundCaptureBuffer8_vtbl);

   type lpIDirectSoundCaptureBuffer8_vtbl is access all IDirectSoundCaptureBuffer8_vtbl;
   type IDirectSoundCaptureBuffer8 is record
      vtbl:lpIDirectSoundCaptureBuffer8_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundCaptureBuffer8);

   --
   -- Interface: IDirectSoundNotify
   --
    
   type af_IDirectSoundNotify_QueryInterface is access procedure(THIS:access IDirectSoundNotify;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundNotify_QueryInterface);

   type af_IDirectSoundNotify_AddRef is access function(THIS:access IDirectSoundNotify) return ULONG;
   pragma convention(stdcall, af_IDirectSoundNotify_AddRef);

   type af_IDirectSoundNotify_Release is access function(THIS:access IDirectSoundNotify) return ULONG;
   pragma convention(stdcall, af_IDirectSoundNotify_Release);

   type af_IDirectSoundNotify_SetNotificationPositions is access procedure(THIS:access IDirectSoundNotify;dwPositionNotifies:DWORD;pcPositionNotifies:LPCDSBPOSITIONNOTIFY);
   pragma convention(stdcall, af_IDirectSoundNotify_SetNotificationPositions);

   type IDirectSoundNotify_vtbl is record
      QueryInterface                :af_IDirectSoundNotify_QueryInterface;
      AddRef                        :af_IDirectSoundNotify_AddRef;
      Release                       :af_IDirectSoundNotify_Release;
      SetNotificationPositions      :af_IDirectSoundNotify_SetNotificationPositions;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundNotify_vtbl);

   type lpIDirectSoundNotify_vtbl is access all IDirectSoundNotify_vtbl;
   type IDirectSoundNotify is record
      vtbl:lpIDirectSoundNotify_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundNotify);
    
   --
   -- Interface: IKsPropertySet
   --
    
   type af_IKsPropertySet_QueryInterface is access procedure(THIS:access IKsPropertySet;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IKsPropertySet_QueryInterface);

   type af_IKsPropertySet_AddRef is access function(THIS:access IKsPropertySet) return ULONG;
   pragma convention(stdcall, af_IKsPropertySet_AddRef);

   type af_IKsPropertySet_Release is access function(THIS:access IKsPropertySet) return ULONG;
   pragma convention(stdcall, af_IKsPropertySet_Release);

   type af_IKsPropertySet_Get is access procedure(THIS:access IKsPropertySet;rguidPropSet:REFGUID;ulId:ULONG;pInstanceData:LPVOID;ulInstanceLength:ULONG;pPropertyData:LPVOID;ulDataLength:ULONG;pulBytesReturned:PULONG);
   pragma convention(stdcall, af_IKsPropertySet_Get);

   type af_IKsPropertySet_Set is access procedure(THIS:access IKsPropertySet;rguidPropSet:REFGUID;ulId:ULONG;pInstanceData:LPVOID;ulInstanceLength:ULONG;pPropertyData:LPVOID;ulDataLength:ULONG);
   pragma convention(stdcall, af_IKsPropertySet_Set);

   type af_IKsPropertySet_QuerySupport is access procedure(THIS:access IKsPropertySet;rguidPropSet:REFGUID;ulId:ULONG;pulTypeSupport:PULONG);
   pragma convention(stdcall, af_IKsPropertySet_QuerySupport);

   type IKsPropertySet_vtbl is record
      QueryInterface      :af_IKsPropertySet_QueryInterface;
      AddRef              :af_IKsPropertySet_AddRef;
      Release             :af_IKsPropertySet_Release;
      Get                 :af_IKsPropertySet_Get;
      Set                 :af_IKsPropertySet_Set;
      QuerySupport        :af_IKsPropertySet_QuerySupport;
   end record;
   pragma convention(C_PASS_BY_COPY,IKsPropertySet_vtbl);

   type lpIKsPropertySet_vtbl is access all IKsPropertySet_vtbl;
   type IKsPropertySet is record
      vtbl:lpIKsPropertySet_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IKsPropertySet);
    
    
   --
   -- Interface: IDirectSoundFXGargle
   --
    
   type af_IDirectSoundFXGargle_QueryInterface is access procedure(THIS:access IDirectSoundFXGargle;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundFXGargle_QueryInterface);

   type af_IDirectSoundFXGargle_AddRef is access function(THIS:access IDirectSoundFXGargle) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXGargle_AddRef);

   type af_IDirectSoundFXGargle_Release is access function(THIS:access IDirectSoundFXGargle) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXGargle_Release);

   type af_IDirectSoundFXGargle_SetAllParameters is access procedure(THIS:access IDirectSoundFXGargle;pcDsFxGargle:LPCDSFXGargle);
   pragma convention(stdcall, af_IDirectSoundFXGargle_SetAllParameters);

   type af_IDirectSoundFXGargle_GetAllParameters is access procedure(THIS:access IDirectSoundFXGargle;pDsFxGargle:LPDSFXGargle);
   pragma convention(stdcall, af_IDirectSoundFXGargle_GetAllParameters);

   type IDirectSoundFXGargle_vtbl is record
      QueryInterface        :af_IDirectSoundFXGargle_QueryInterface;
      AddRef                :af_IDirectSoundFXGargle_AddRef;
      Release               :af_IDirectSoundFXGargle_Release;
      SetAllParameters      :af_IDirectSoundFXGargle_SetAllParameters;
      GetAllParameters      :af_IDirectSoundFXGargle_GetAllParameters;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXGargle_vtbl);

   type lpIDirectSoundFXGargle_vtbl is access all IDirectSoundFXGargle_vtbl;
   type IDirectSoundFXGargle is record
      vtbl:lpIDirectSoundFXGargle_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXGargle);
    
    
   --
   -- Interface: IDirectSoundFXChorus
   --
    
   type af_IDirectSoundFXChorus_QueryInterface is access procedure(THIS:access IDirectSoundFXChorus;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundFXChorus_QueryInterface);

   type af_IDirectSoundFXChorus_AddRef is access function(THIS:access IDirectSoundFXChorus) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXChorus_AddRef);

   type af_IDirectSoundFXChorus_Release is access function(THIS:access IDirectSoundFXChorus) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXChorus_Release);

   type af_IDirectSoundFXChorus_SetAllParameters is access procedure(THIS:access IDirectSoundFXChorus;pcDsFxChorus:LPCDSFXChorus);
   pragma convention(stdcall, af_IDirectSoundFXChorus_SetAllParameters);

   type af_IDirectSoundFXChorus_GetAllParameters is access procedure(THIS:access IDirectSoundFXChorus;pDsFxChorus:LPDSFXChorus);
   pragma convention(stdcall, af_IDirectSoundFXChorus_GetAllParameters);

   type IDirectSoundFXChorus_vtbl is record
      QueryInterface      :af_IDirectSoundFXChorus_QueryInterface;
      AddRef      :af_IDirectSoundFXChorus_AddRef;
      Release      :af_IDirectSoundFXChorus_Release;
      SetAllParameters      :af_IDirectSoundFXChorus_SetAllParameters;
      GetAllParameters      :af_IDirectSoundFXChorus_GetAllParameters;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXChorus_vtbl);

   type lpIDirectSoundFXChorus_vtbl is access all IDirectSoundFXChorus_vtbl;
   type IDirectSoundFXChorus is record
      vtbl:lpIDirectSoundFXChorus_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXChorus);
    
    
   --
   -- Interface: 
   --
    
   type af_IDirectSoundFXFlanger_QueryInterface is access procedure(THIS:access IDirectSoundFXFlanger;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundFXFlanger_QueryInterface);

   type af_IDirectSoundFXFlanger_AddRef is access function(THIS:access IDirectSoundFXFlanger) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXFlanger_AddRef);

   type af_IDirectSoundFXFlanger_Release is access function(THIS:access IDirectSoundFXFlanger) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXFlanger_Release);

   type af_IDirectSoundFXFlanger_SetAllParameters is access procedure(THIS:access IDirectSoundFXFlanger;pcDsFxFlanger:LPCDSFXFlanger);
   pragma convention(stdcall, af_IDirectSoundFXFlanger_SetAllParameters);

   type af_IDirectSoundFXFlanger_GetAllParameters is access procedure(THIS:access IDirectSoundFXFlanger;pDsFxFlanger:LPDSFXFlanger);
   pragma convention(stdcall, af_IDirectSoundFXFlanger_GetAllParameters);

   type IDirectSoundFXFlanger_vtbl is record
      QueryInterface      :af_IDirectSoundFXFlanger_QueryInterface;
      AddRef      :af_IDirectSoundFXFlanger_AddRef;
      Release      :af_IDirectSoundFXFlanger_Release;
      SetAllParameters      :af_IDirectSoundFXFlanger_SetAllParameters;
      GetAllParameters      :af_IDirectSoundFXFlanger_GetAllParameters;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXFlanger_vtbl);

   type lpIDirectSoundFXFlanger_vtbl is access all IDirectSoundFXFlanger_vtbl;
   type IDirectSoundFXFlanger is record
      vtbl:lpIDirectSoundFXFlanger_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXFlanger);
    
    
   --
   -- Interface: IDirectSoundFXEcho
   --

   type af_IDirectSoundFXEcho_QueryInterface is access procedure(THIS:access IDirectSoundFXEcho;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundFXEcho_QueryInterface);

   type af_IDirectSoundFXEcho_AddRef is access function(THIS:access IDirectSoundFXEcho) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXEcho_AddRef);

   type af_IDirectSoundFXEcho_Release is access function(THIS:access IDirectSoundFXEcho) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXEcho_Release);

   type af_IDirectSoundFXEcho_SetAllParameters is access procedure(THIS:access IDirectSoundFXEcho;pcDsFxEcho:LPCDSFXEcho);
   pragma convention(stdcall, af_IDirectSoundFXEcho_SetAllParameters);

   type af_IDirectSoundFXEcho_GetAllParameters is access procedure(THIS:access IDirectSoundFXEcho;pDsFxEcho:LPDSFXEcho);
   pragma convention(stdcall, af_IDirectSoundFXEcho_GetAllParameters);

   type IDirectSoundFXEcho_vtbl is record
      QueryInterface      :af_IDirectSoundFXEcho_QueryInterface;
      AddRef      :af_IDirectSoundFXEcho_AddRef;
      Release      :af_IDirectSoundFXEcho_Release;
      SetAllParameters      :af_IDirectSoundFXEcho_SetAllParameters;
      GetAllParameters      :af_IDirectSoundFXEcho_GetAllParameters;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXEcho_vtbl);

   type lpIDirectSoundFXEcho_vtbl is access all IDirectSoundFXEcho_vtbl;
   type IDirectSoundFXEcho is record
      vtbl:lpIDirectSoundFXEcho_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXEcho);
    
    
   --
   -- Interface: IDirectSoundFXDistortion
   --
    
   type af_IDirectSoundFXDistortion_QueryInterface is access procedure(THIS:access IDirectSoundFXDistortion;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundFXDistortion_QueryInterface);

   type af_IDirectSoundFXDistortion_AddRef is access function(THIS:access IDirectSoundFXDistortion) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXDistortion_AddRef);

   type af_IDirectSoundFXDistortion_Release is access function(THIS:access IDirectSoundFXDistortion) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXDistortion_Release);

   type af_IDirectSoundFXDistortion_SetAllParameters is access procedure(THIS:access IDirectSoundFXDistortion;pcDsFxDistortion:LPCDSFXDistortion);
   pragma convention(stdcall, af_IDirectSoundFXDistortion_SetAllParameters);

   type af_IDirectSoundFXDistortion_GetAllParameters is access procedure(THIS:access IDirectSoundFXDistortion;pDsFxDistortion:LPDSFXDistortion);
   pragma convention(stdcall, af_IDirectSoundFXDistortion_GetAllParameters);

   type IDirectSoundFXDistortion_vtbl is record
      QueryInterface      :af_IDirectSoundFXDistortion_QueryInterface;
      AddRef      :af_IDirectSoundFXDistortion_AddRef;
      Release      :af_IDirectSoundFXDistortion_Release;
      SetAllParameters      :af_IDirectSoundFXDistortion_SetAllParameters;
      GetAllParameters      :af_IDirectSoundFXDistortion_GetAllParameters;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXDistortion_vtbl);

   type lpIDirectSoundFXDistortion_vtbl is access all IDirectSoundFXDistortion_vtbl;
   type IDirectSoundFXDistortion is record
      vtbl:lpIDirectSoundFXDistortion_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXDistortion);
    
   --
   -- Interface: IDirectSoundFXCompressor
   -- 
   
   type af_IDirectSoundFXCompressor_QueryInterface is access procedure(THIS:access IDirectSoundFXCompressor;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundFXCompressor_QueryInterface);

   type af_IDirectSoundFXCompressor_AddRef is access function(THIS:access IDirectSoundFXCompressor) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXCompressor_AddRef);

   type af_IDirectSoundFXCompressor_Release is access function(THIS:access IDirectSoundFXCompressor) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXCompressor_Release);

   type af_IDirectSoundFXCompressor_SetAllParameters is access procedure(THIS:access IDirectSoundFXCompressor;pcDsFxCompressor:LPCDSFXCompressor);
   pragma convention(stdcall, af_IDirectSoundFXCompressor_SetAllParameters);

   type af_IDirectSoundFXCompressor_GetAllParameters is access procedure(THIS:access IDirectSoundFXCompressor;pDsFxCompressor:LPDSFXCompressor);
   pragma convention(stdcall, af_IDirectSoundFXCompressor_GetAllParameters);

   type IDirectSoundFXCompressor_vtbl is record
      QueryInterface      :af_IDirectSoundFXCompressor_QueryInterface;
      AddRef      :af_IDirectSoundFXCompressor_AddRef;
      Release      :af_IDirectSoundFXCompressor_Release;
      SetAllParameters      :af_IDirectSoundFXCompressor_SetAllParameters;
      GetAllParameters      :af_IDirectSoundFXCompressor_GetAllParameters;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXCompressor_vtbl);

   type lpIDirectSoundFXCompressor_vtbl is access all IDirectSoundFXCompressor_vtbl;
   type IDirectSoundFXCompressor is record
      vtbl:lpIDirectSoundFXCompressor_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXCompressor);

   
   --
   -- Interface: IDirectSoundFXParamEq
   --
    
   type af_IDirectSoundFXParamEq_QueryInterface is access procedure(THIS:access IDirectSoundFXParamEq;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundFXParamEq_QueryInterface);

   type af_IDirectSoundFXParamEq_AddRef is access function(THIS:access IDirectSoundFXParamEq) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXParamEq_AddRef);

   type af_IDirectSoundFXParamEq_Release is access function(THIS:access IDirectSoundFXParamEq) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXParamEq_Release);

   type af_IDirectSoundFXParamEq_SetAllParameters is access procedure(THIS:access IDirectSoundFXParamEq;pcDsFxParamEq:LPCDSFXParamEq);
   pragma convention(stdcall, af_IDirectSoundFXParamEq_SetAllParameters);

   type af_IDirectSoundFXParamEq_GetAllParameters is access procedure(THIS:access IDirectSoundFXParamEq;pDsFxParamEq:LPDSFXParamEq);
   pragma convention(stdcall, af_IDirectSoundFXParamEq_GetAllParameters);

   type IDirectSoundFXParamEq_vtbl is record
      QueryInterface      :af_IDirectSoundFXParamEq_QueryInterface;
      AddRef      :af_IDirectSoundFXParamEq_AddRef;
      Release      :af_IDirectSoundFXParamEq_Release;
      SetAllParameters      :af_IDirectSoundFXParamEq_SetAllParameters;
      GetAllParameters      :af_IDirectSoundFXParamEq_GetAllParameters;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXParamEq_vtbl);

   type lpIDirectSoundFXParamEq_vtbl is access all IDirectSoundFXParamEq_vtbl;
   type IDirectSoundFXParamEq is record
      vtbl:lpIDirectSoundFXParamEq_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXParamEq);
    
    
   --
   -- Interface: IDirectSoundFXI3DL2Reverb
   --
    
   type af_IDirectSoundFXI3DL2Reverb_QueryInterface is access procedure(THIS:access IDirectSoundFXI3DL2Reverb;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundFXI3DL2Reverb_QueryInterface);

   type af_IDirectSoundFXI3DL2Reverb_AddRef is access function(THIS:access IDirectSoundFXI3DL2Reverb) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXI3DL2Reverb_AddRef);

   type af_IDirectSoundFXI3DL2Reverb_Release is access function(THIS:access IDirectSoundFXI3DL2Reverb) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXI3DL2Reverb_Release);

   type af_IDirectSoundFXI3DL2Reverb_SetAllParameters is access procedure(THIS:access IDirectSoundFXI3DL2Reverb;pcDsFxI3DL2Reverb:LPCDSFXI3DL2Reverb);
   pragma convention(stdcall, af_IDirectSoundFXI3DL2Reverb_SetAllParameters);

   type af_IDirectSoundFXI3DL2Reverb_GetAllParameters is access procedure(THIS:access IDirectSoundFXI3DL2Reverb;pDsFxI3DL2Reverb:LPDSFXI3DL2Reverb);
   pragma convention(stdcall, af_IDirectSoundFXI3DL2Reverb_GetAllParameters);

   type af_IDirectSoundFXI3DL2Reverb_SetPreset is access procedure(THIS:access IDirectSoundFXI3DL2Reverb;dwPreset:DWORD);
   pragma convention(stdcall, af_IDirectSoundFXI3DL2Reverb_SetPreset);

   type af_IDirectSoundFXI3DL2Reverb_GetPreset is access procedure(THIS:access IDirectSoundFXI3DL2Reverb;pdwPreset:LPDWORD);
   pragma convention(stdcall, af_IDirectSoundFXI3DL2Reverb_GetPreset);

   type af_IDirectSoundFXI3DL2Reverb_SetQuality is access procedure(THIS:access IDirectSoundFXI3DL2Reverb;lQuality:LONG);
   pragma convention(stdcall, af_IDirectSoundFXI3DL2Reverb_SetQuality);

   type af_IDirectSoundFXI3DL2Reverb_GetQuality is access procedure(THIS:access IDirectSoundFXI3DL2Reverb;plQuality:access LONG);
   pragma convention(stdcall, af_IDirectSoundFXI3DL2Reverb_GetQuality);

   type IDirectSoundFXI3DL2Reverb_vtbl is record
      QueryInterface      :af_IDirectSoundFXI3DL2Reverb_QueryInterface;
      AddRef      :af_IDirectSoundFXI3DL2Reverb_AddRef;
      Release      :af_IDirectSoundFXI3DL2Reverb_Release;
      SetAllParameters      :af_IDirectSoundFXI3DL2Reverb_SetAllParameters;
      GetAllParameters      :af_IDirectSoundFXI3DL2Reverb_GetAllParameters;
      SetPreset      :af_IDirectSoundFXI3DL2Reverb_SetPreset;
      GetPreset      :af_IDirectSoundFXI3DL2Reverb_GetPreset;
      SetQuality      :af_IDirectSoundFXI3DL2Reverb_SetQuality;
      GetQuality      :af_IDirectSoundFXI3DL2Reverb_GetQuality;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXI3DL2Reverb_vtbl);

   type lpIDirectSoundFXI3DL2Reverb_vtbl is access all IDirectSoundFXI3DL2Reverb_vtbl;
   type IDirectSoundFXI3DL2Reverb is record
      vtbl:lpIDirectSoundFXI3DL2Reverb_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXI3DL2Reverb);

   --
   -- Interface: IDirectSoundFXWavesReverb
   --
    
   type af_IDirectSoundFXWavesReverb_QueryInterface is access procedure(THIS:access IDirectSoundFXWavesReverb;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundFXWavesReverb_QueryInterface);

   type af_IDirectSoundFXWavesReverb_AddRef is access function(THIS:access IDirectSoundFXWavesReverb) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXWavesReverb_AddRef);

   type af_IDirectSoundFXWavesReverb_Release is access function(THIS:access IDirectSoundFXWavesReverb) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFXWavesReverb_Release);

   type af_IDirectSoundFXWavesReverb_SetAllParameters is access procedure(THIS:access IDirectSoundFXWavesReverb;pcDsFxWavesReverb:LPCDSFXWavesReverb);
   pragma convention(stdcall, af_IDirectSoundFXWavesReverb_SetAllParameters);

   type af_IDirectSoundFXWavesReverb_GetAllParameters is access procedure(THIS:access IDirectSoundFXWavesReverb;pDsFxWavesReverb:LPDSFXWavesReverb);
   pragma convention(stdcall, af_IDirectSoundFXWavesReverb_GetAllParameters);

   type IDirectSoundFXWavesReverb_vtbl is record
      QueryInterface      :af_IDirectSoundFXWavesReverb_QueryInterface;
      AddRef      :af_IDirectSoundFXWavesReverb_AddRef;
      Release      :af_IDirectSoundFXWavesReverb_Release;
      SetAllParameters      :af_IDirectSoundFXWavesReverb_SetAllParameters;
      GetAllParameters      :af_IDirectSoundFXWavesReverb_GetAllParameters;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXWavesReverb_vtbl);

   type lpIDirectSoundFXWavesReverb_vtbl is access all IDirectSoundFXWavesReverb_vtbl;
   type IDirectSoundFXWavesReverb is record
      vtbl:lpIDirectSoundFXWavesReverb_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFXWavesReverb);
    
    
   --
   -- Interface: IDirectSoundCaptureFXAec
   --
    
   type af_IDirectSoundCaptureFXAec_QueryInterface is access procedure(THIS:access IDirectSoundCaptureFXAec;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundCaptureFXAec_QueryInterface);

   type af_IDirectSoundCaptureFXAec_AddRef is access function(THIS:access IDirectSoundCaptureFXAec) return ULONG;
   pragma convention(stdcall, af_IDirectSoundCaptureFXAec_AddRef);

   type af_IDirectSoundCaptureFXAec_Release is access function(THIS:access IDirectSoundCaptureFXAec) return ULONG;
   pragma convention(stdcall, af_IDirectSoundCaptureFXAec_Release);

   type af_IDirectSoundCaptureFXAec_SetAllParameters is access procedure(THIS:access IDirectSoundCaptureFXAec;pDscFxAec:LPCDSCFXAec);
   pragma convention(stdcall, af_IDirectSoundCaptureFXAec_SetAllParameters);

   type af_IDirectSoundCaptureFXAec_GetAllParameters is access procedure(THIS:access IDirectSoundCaptureFXAec;pDscFxAec:LPDSCFXAec);
   pragma convention(stdcall, af_IDirectSoundCaptureFXAec_GetAllParameters);

   type af_IDirectSoundCaptureFXAec_GetStatus is access procedure(THIS:access IDirectSoundCaptureFXAec;pdwStatus:PDWORD);
   pragma convention(stdcall, af_IDirectSoundCaptureFXAec_GetStatus);

   type af_IDirectSoundCaptureFXAec_Reset is access procedure(THIS:access IDirectSoundCaptureFXAec);
   pragma convention(stdcall, af_IDirectSoundCaptureFXAec_Reset);

   type IDirectSoundCaptureFXAec_vtbl is record
      QueryInterface      :af_IDirectSoundCaptureFXAec_QueryInterface;
      AddRef      :af_IDirectSoundCaptureFXAec_AddRef;
      Release      :af_IDirectSoundCaptureFXAec_Release;
      SetAllParameters      :af_IDirectSoundCaptureFXAec_SetAllParameters;
      GetAllParameters      :af_IDirectSoundCaptureFXAec_GetAllParameters;
      GetStatus      :af_IDirectSoundCaptureFXAec_GetStatus;
      Reset      :af_IDirectSoundCaptureFXAec_Reset;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundCaptureFXAec_vtbl);

   type lpIDirectSoundCaptureFXAec_vtbl is access all IDirectSoundCaptureFXAec_vtbl;
   type IDirectSoundCaptureFXAec is record
      vtbl:lpIDirectSoundCaptureFXAec_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundCaptureFXAec);

   --
   -- Interface: IDirectSoundCaptureFXNoiseSuppress
   --
    
   type af_IDirectSoundCaptureFXNoiseSuppress_QueryInterface is access procedure(THIS:access IDirectSoundCaptureFXNoiseSuppress;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundCaptureFXNoiseSuppress_QueryInterface);

   type af_IDirectSoundCaptureFXNoiseSuppress_AddRef is access function(THIS:access IDirectSoundCaptureFXNoiseSuppress) return ULONG;
   pragma convention(stdcall, af_IDirectSoundCaptureFXNoiseSuppress_AddRef);

   type af_IDirectSoundCaptureFXNoiseSuppress_Release is access function(THIS:access IDirectSoundCaptureFXNoiseSuppress) return ULONG;
   pragma convention(stdcall, af_IDirectSoundCaptureFXNoiseSuppress_Release);

   type af_IDirectSoundCaptureFXNoiseSuppress_SetAllParameters is access procedure(THIS:access IDirectSoundCaptureFXNoiseSuppress;pcDscFxNoiseSuppress:LPCDSCFXNoiseSuppress);
   pragma convention(stdcall, af_IDirectSoundCaptureFXNoiseSuppress_SetAllParameters);

   type af_IDirectSoundCaptureFXNoiseSuppress_GetAllParameters is access procedure(THIS:access IDirectSoundCaptureFXNoiseSuppress;pDscFxNoiseSuppress:LPDSCFXNoiseSuppress);
   pragma convention(stdcall, af_IDirectSoundCaptureFXNoiseSuppress_GetAllParameters);

   type af_IDirectSoundCaptureFXNoiseSuppress_Reset is access procedure(THIS:access IDirectSoundCaptureFXNoiseSuppress);
   pragma convention(stdcall, af_IDirectSoundCaptureFXNoiseSuppress_Reset);

   type IDirectSoundCaptureFXNoiseSuppress_vtbl is record
      QueryInterface      :af_IDirectSoundCaptureFXNoiseSuppress_QueryInterface;
      AddRef      :af_IDirectSoundCaptureFXNoiseSuppress_AddRef;
      Release      :af_IDirectSoundCaptureFXNoiseSuppress_Release;
      SetAllParameters      :af_IDirectSoundCaptureFXNoiseSuppress_SetAllParameters;
      GetAllParameters      :af_IDirectSoundCaptureFXNoiseSuppress_GetAllParameters;
      Reset      :af_IDirectSoundCaptureFXNoiseSuppress_Reset;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundCaptureFXNoiseSuppress_vtbl);

   type lpIDirectSoundCaptureFXNoiseSuppress_vtbl is access all IDirectSoundCaptureFXNoiseSuppress_vtbl;
   type IDirectSoundCaptureFXNoiseSuppress is record
      vtbl:lpIDirectSoundCaptureFXNoiseSuppress_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundCaptureFXNoiseSuppress);
    
    
   --
   -- Interface: IDirectSoundFullDuplex
   --

   type af_IDirectSoundFullDuplex_QueryInterface is access procedure(THIS:access IDirectSoundFullDuplex;IID:REFIID;ppvObj:access LPVOID);
   pragma convention(stdcall, af_IDirectSoundFullDuplex_QueryInterface);

   type af_IDirectSoundFullDuplex_AddRef is access function(THIS:access IDirectSoundFullDuplex) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFullDuplex_AddRef);

   type af_IDirectSoundFullDuplex_Release is access function(THIS:access IDirectSoundFullDuplex) return ULONG;
   pragma convention(stdcall, af_IDirectSoundFullDuplex_Release);

   type af_IDirectSoundFullDuplex_Initialize is access procedure(THIS:access IDirectSoundFullDuplex;pCaptureGuid:LPCGUID;pRenderGuid:LPCGUID;lpDscBufferDesc:LPCDSCBUFFERDESC;lpDsBufferDesc:LPCDSBUFFERDESC;hWd:HWND;dwLevel:DWORD;ppDirectSoundCaptureBuffer8:LPLPDIRECTSOUNDCAPTUREBUFFER8;ppDirectSoundBuffer8:LPLPDIRECTSOUNDBUFFER8);
   pragma convention(stdcall, af_IDirectSoundFullDuplex_Initialize);

   type IDirectSoundFullDuplex_vtbl is record
      QueryInterface      :af_IDirectSoundFullDuplex_QueryInterface;
      AddRef      :af_IDirectSoundFullDuplex_AddRef;
      Release      :af_IDirectSoundFullDuplex_Release;
      Initialize      :af_IDirectSoundFullDuplex_Initialize;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFullDuplex_vtbl);

   type lpIDirectSoundFullDuplex_vtbl is access all IDirectSoundFullDuplex_vtbl;
   type IDirectSoundFullDuplex is record
      vtbl:lpIDirectSoundFullDuplex_vtbl;
   end record;
   pragma convention(C_PASS_BY_COPY,IDirectSoundFullDuplex);
    
    
   --
   -- Return Codes
   --

   -- The function completed successfully
   DS_OK                           :constant:=0;

   -- The call succeeded, but we had to substitute the 3D algorithm
   DS_NO_VIRTUALIZATION            :constant:=142082058;  --MAKE_HRESULT(0, FACDS, 10);

   -- The call failed because resources (such as a priority level)
   -- were already being used by another caller
   DSERR_ALLOCATED                 :constant:=-2005401590; --MAKE_DSHRESULT(10);

   -- The control (vol, pan, etc.) requested by the caller is not available
   DSERR_CONTROLUNAVAIL            :constant:=-2005401570; --MAKE_DSHRESULT(30);

   -- An invalid parameter was passed to the returning function
   DSERR_INVALIDPARAM              :constant:=win32.winerror.E_INVALIDARG;

   -- This call is not valid for the current state of this object
   DSERR_INVALIDCALL               :constant:=-2005401550; --MAKE_DSHRESULT(50);

   -- An undetermined error occurred inside the DirectSound subsystem
   DSERR_GENERIC                   :constant:=win32.winerror.E_FAIL;

   -- The caller does not have the priority level required for the function to
   -- succeed
   DSERR_PRIOLEVELNEEDED           :constant:=-2005401530; --MAKE_DSHRESULT(70);

   -- Not enough free memory is available to complete the operation
   DSERR_OUTOFMEMORY               :constant:=win32.winerror.E_OUTOFMEMORY;

   -- The specified WAVE format is not supported
   DSERR_BADFORMAT                 :constant:=-2005401500; --MAKE_DSHRESULT(100);

   -- The function called is not supported at this time
   DSERR_UNSUPPORTED               :constant:=win32.winerror.E_NOTIMPL;

   -- No sound driver is available for use
   DSERR_NODRIVER                  :constant:=-2005401480; --MAKE_DSHRESULT(120);

   -- This object is already initialized
   DSERR_ALREADYINITIALIZED        :constant:=-2005401470; --MAKE_DSHRESULT(130);

   -- This object does not support aggregation
   DSERR_NOAGGREGATION             :constant:=win32.winerror.CLASS_E_NOAGGREGATION;

   -- The buffer memory has been lost, and must be restored
   DSERR_BUFFERLOST                :constant:=-2005401450;  --MAKE_DSHRESULT(150);

   -- Another app has a higher priority level, preventing this call from
   -- succeeding
   DSERR_OTHERAPPHASPRIO           :constant:=-2005401440;  --MAKE_DSHRESULT(160);

   -- This object has not been initialized
   DSERR_UNINITIALIZED             :constant:=-2005401430;  --MAKE_DSHRESULT(170);

   -- The requested COM interface is not available
   DSERR_NOINTERFACE               :constant:=win32.winerror.E_NOINTERFACE;

   -- Access is denied
   DSERR_ACCESSDENIED              :constant:=win32.winerror.E_ACCESSDENIED;

   -- Tried to create a DSBCAPS_CTRLFX buffer shorter than DSBSIZE_FX_MIN milliseconds
   DSERR_BUFFERTOOSMALL            :constant:=-2005401420;  --MAKE_DSHRESULT(180);

   -- Attempt to use DirectSound 8 functionality on an older DirectSound object
   DSERR_DS8_REQUIRED              :constant:=-2005401410;  --MAKE_DSHRESULT(190);

   -- A circular loop of send effects was detected
   DSERR_SENDLOOP                  :constant:=-2005401400; --MAKE_DSHRESULT(200);

   -- The GUID specified in an audiopath file does not match a valid MIXIN buffer
   DSERR_BADSENDBUFFERGUID         :constant:=-2005401390;  --MAKE_DSHRESULT(210);

   -- The object requested was not found (numerically equal to DMUS_E_NOT_FOUND)
   DSERR_OBJECTNOTFOUND            :constant:=-2005397151;  --MAKE_DSHRESULT(4449);

   -- The effects requested could not be found on the system, or they were found
   -- but in the wrong order, or in the wrong hardware/software locations.
   DSERR_FXUNAVAILABLE             :constant:=-2005401380;  --MAKE_DSHRESULT(220);
    
    
    
   --
   -- Flags
   --

   DSCAPS_PRIMARYMONO          :constant:=16#00000001#;
   DSCAPS_PRIMARYSTEREO        :constant:=16#00000002#;
   DSCAPS_PRIMARY8BIT          :constant:=16#00000004#;
   DSCAPS_PRIMARY16BIT         :constant:=16#00000008#;
   DSCAPS_CONTINUOUSRATE       :constant:=16#00000010#;
   DSCAPS_EMULDRIVER           :constant:=16#00000020#;
   DSCAPS_CERTIFIED            :constant:=16#00000040#;
   DSCAPS_SECONDARYMONO        :constant:=16#00000100#;
   DSCAPS_SECONDARYSTEREO      :constant:=16#00000200#;
   DSCAPS_SECONDARY8BIT        :constant:=16#00000400#;
   DSCAPS_SECONDARY16BIT       :constant:=16#00000800#;

   DSSCL_NORMAL                :constant:=16#00000001#;
   DSSCL_PRIORITY              :constant:=16#00000002#;
   DSSCL_EXCLUSIVE             :constant:=16#00000003#;
   DSSCL_WRITEPRIMARY          :constant:=16#00000004#;

   DSSPEAKER_DIRECTOUT         :constant:=16#00000000#;
   DSSPEAKER_HEADPHONE         :constant:=16#00000001#;
   DSSPEAKER_MONO              :constant:=16#00000002#;
   DSSPEAKER_QUAD              :constant:=16#00000003#;
   DSSPEAKER_STEREO            :constant:=16#00000004#;
   DSSPEAKER_SURROUND          :constant:=16#00000005#;
   DSSPEAKER_5POINT1           :constant:=16#00000006#;
   DSSPEAKER_7POINT1           :constant:=16#00000007#;

   DSSPEAKER_GEOMETRY_MIN      :constant:=16#00000005#;    --   5 degrees
   DSSPEAKER_GEOMETRY_NARROW   :constant:=16#0000000A#;    --  10 degrees
   DSSPEAKER_GEOMETRY_WIDE     :constant:=16#00000014#;    --  20 degrees
   DSSPEAKER_GEOMETRY_MAX      :constant:=16#000000B4#;    -- 180 degrees
    
   --#define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
   --#define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
   --#define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
   function  DSSPEAKER_COMBINED(c:byte;g:byte) return DWORD;
    
   generic
      type T is (<>);
   function  DSSPEAKER_CONFIG(a:T) return byte; 
    
   generic
      type T is (<>);
   function DSSPEAKER_GEOMETRY(a:T) return BYTE;
    
   DSBCAPS_PRIMARYBUFFER       :constant:=16#00000001#;
   DSBCAPS_STATIC              :constant:=16#00000002#;
   DSBCAPS_LOCHARDWARE         :constant:=16#00000004#;
   DSBCAPS_LOCSOFTWARE         :constant:=16#00000008#;
   DSBCAPS_CTRL3D              :constant:=16#00000010#;
   DSBCAPS_CTRLFREQUENCY       :constant:=16#00000020#;
   DSBCAPS_CTRLPAN             :constant:=16#00000040#;
   DSBCAPS_CTRLVOLUME          :constant:=16#00000080#;
   DSBCAPS_CTRLPOSITIONNOTIFY  :constant:=16#00000100#;
   DSBCAPS_CTRLFX              :constant:=16#00000200#;
   DSBCAPS_STICKYFOCUS         :constant:=16#00004000#;
   DSBCAPS_GLOBALFOCUS         :constant:=16#00008000#;
   DSBCAPS_GETCURRENTPOSITION2 :constant:=16#00010000#;
   DSBCAPS_MUTE3DATMAXDISTANCE :constant:=16#00020000#;
   DSBCAPS_LOCDEFER            :constant:=16#00040000#;

   DSBPLAY_LOOPING             :constant:=16#00000001#;
   DSBPLAY_LOCHARDWARE         :constant:=16#00000002#;
   DSBPLAY_LOCSOFTWARE         :constant:=16#00000004#;
   DSBPLAY_TERMINATEBY_TIME    :constant:=16#00000008#;
   DSBPLAY_TERMINATEBY_DISTANCE    :constant:=16#000000010#;
   DSBPLAY_TERMINATEBY_PRIORITY    :constant:=16#000000020#;

   DSBSTATUS_PLAYING           :constant:=16#00000001#;
   DSBSTATUS_BUFFERLOST        :constant:=16#00000002#;
   DSBSTATUS_LOOPING           :constant:=16#00000004#;
   DSBSTATUS_LOCHARDWARE       :constant:=16#00000008#;
   DSBSTATUS_LOCSOFTWARE       :constant:=16#00000010#;
   DSBSTATUS_TERMINATED        :constant:=16#00000020#;

   DSBLOCK_FROMWRITECURSOR     :constant:=16#00000001#;
   DSBLOCK_ENTIREBUFFER        :constant:=16#00000002#;

   DSBFREQUENCY_ORIGINAL       :constant:=0;
   DSBFREQUENCY_MIN            :constant:=100;
   --#if DIRECTSOUND_VERSION >= :constant:=16#0900#
   DSBFREQUENCY_MAX            :constant:=200000;
   --#else
   --DSBFREQUENCY_MAX            :constant:=100000;
   --#endif

   DSBPAN_LEFT                 :constant:=-10000;
   DSBPAN_CENTER               :constant:=0;
   DSBPAN_RIGHT                :constant:=10000;

   DSBVOLUME_MIN               :constant:=-10000;
   DSBVOLUME_MAX               :constant:=0;

   DSBSIZE_MIN                 :constant:=4;
   DSBSIZE_MAX                 :constant:=16#0FFFFFFF#;
   DSBSIZE_FX_MIN              :constant:=150;     -- NOTE: Milliseconds, not bytes

   DS3DMODE_NORMAL             :constant:=16#00000000#;
   DS3DMODE_HEADRELATIVE       :constant:=16#00000001#;
   DS3DMODE_DISABLE            :constant:=16#00000002#;

   DS3D_IMMEDIATE              :constant:=16#00000000#;
   DS3D_DEFERRED               :constant:=16#00000001#;

   DS3D_MINDISTANCEFACTOR      :constant:=FLT_MIN;
   DS3D_MAXDISTANCEFACTOR      :constant:=FLT_MAX;
   DS3D_DEFAULTDISTANCEFACTOR  :constant:=1.0;

   DS3D_MINROLLOFFFACTOR       :constant:=0.0;
   DS3D_MAXROLLOFFFACTOR       :constant:=10.0;
   DS3D_DEFAULTROLLOFFFACTOR   :constant:=1.0;

   DS3D_MINDOPPLERFACTOR       :constant:=0.0;
   DS3D_MAXDOPPLERFACTOR       :constant:=10.0;
   DS3D_DEFAULTDOPPLERFACTOR   :constant:=1.0;

   DS3D_DEFAULTMINDISTANCE     :constant:=1.0;
   DS3D_DEFAULTMAXDISTANCE     :constant:=1000000000.0;

   DS3D_MINCONEANGLE           :constant:=0;
   DS3D_MAXCONEANGLE           :constant:=360;
   DS3D_DEFAULTCONEANGLE       :constant:=360;

   DS3D_DEFAULTCONEOUTSIDEVOLUME :constant:=DSBVOLUME_MAX;

   -- IDirectSoundCapture attributes

   DSCCAPS_EMULDRIVER          :constant:=DSCAPS_EMULDRIVER;
   DSCCAPS_CERTIFIED           :constant:=DSCAPS_CERTIFIED;
   DSCCAPS_MULTIPLECAPTURE     :constant:=16#00000001#;

   -- IDirectSoundCaptureBuffer attributes

   DSCBCAPS_WAVEMAPPED         :constant:=16#80000000#;
    
    
   --#if DIRECTSOUND_VERSION >= :constant:=16#0800#
   DSCBCAPS_CTRLFX             :constant:=16#00000200#;
   --#endif


   DSCBLOCK_ENTIREBUFFER       :constant:=16#00000001#;

   DSCBSTATUS_CAPTURING        :constant:=16#00000001#;
   DSCBSTATUS_LOOPING          :constant:=16#00000002#;

   DSCBSTART_LOOPING           :constant:=16#00000001#;

   DSBPN_OFFSETSTOP            :constant:=16#FFFFFFFF#;

   DS_CERTIFIED                :constant:=16#00000000#;
   DS_UNCERTIFIED              :constant:=16#00000001#;

   --Flags for the I3DL2 effects
   DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW   :constant:= 0;
   DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW   :constant:= 1;
   DSFX_I3DL2_MATERIAL_PRESET_THINDOOR       :constant:= 2;
   DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR      :constant:= 3;
   DSFX_I3DL2_MATERIAL_PRESET_WOODWALL       :constant:= 4;
   DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL      :constant:= 5;
   DSFX_I3DL2_MATERIAL_PRESET_STONEWALL      :constant:= 6;
   DSFX_I3DL2_MATERIAL_PRESET_CURTAIN        :constant:= 7;
    
    
    
   DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT        :constant:= 0;
   DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC        :constant:= 1;
   DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL     :constant:= 2;
   DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM           :constant:= 3;
   DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM       :constant:= 4;
   DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM     :constant:= 5;
   DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM      :constant:= 6;
   DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM     :constant:= 7;
   DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL    :constant:= 8;
   DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE           :constant:= 9;
   DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA          :constant:= 10;
   DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR         :constant:= 11;
   DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY:constant:= 12;
   DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY        :constant:= 13;
   DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR  :constant:= 14;
   DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY          :constant:= 15;
   DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST         :constant:= 16;
   DSFX_I3DL2_ENVIRONMENT_PRESET_CITY           :constant:= 17;
   DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS      :constant:= 18;
   DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY         :constant:= 19;
   DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN          :constant:= 20;
   DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT     :constant:= 21;
   DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE      :constant:= 22;
   DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER     :constant:= 23;
   DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM      :constant:= 24;
   DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM     :constant:= 25;
   DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM      :constant:= 26;
   DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL     :constant:= 27;
   DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL      :constant:= 28;
   DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE          :constant:= 29;
    
    
   use type Interfaces.C.long;
    
   I3DL2_ENVIRONMENT_PRESET_DEFAULT         :constant DSFXI3DL2Reverb:=(-1000, -100, 0.0, 1.49, 0.83, -2602, 0.007,   200, 0.011, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_GENERIC         :constant DSFXI3DL2Reverb:=(-1000, -100, 0.0, 1.49, 0.83, -2602, 0.007,   200, 0.011, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_PADDEDCELL      :constant DSFXI3DL2Reverb:=(-1000,-6000, 0.0, 0.17, 0.10, -1204, 0.001,   207, 0.002, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_ROOM            :constant DSFXI3DL2Reverb:=(-1000, -454, 0.0, 0.40, 0.83, -1646, 0.002,    53, 0.003, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_BATHROOM        :constant DSFXI3DL2Reverb:=(-1000,-1200, 0.0, 1.49, 0.54,  -370, 0.007,  1030, 0.011, 100.0,  60.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_LIVINGROOM      :constant DSFXI3DL2Reverb:=(-1000,-6000, 0.0, 0.50, 0.10, -1376, 0.003, -1104, 0.004, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_STONEROOM       :constant DSFXI3DL2Reverb:=(-1000, -300, 0.0, 2.31, 0.64,  -711, 0.012,    83, 0.017, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_AUDITORIUM      :constant DSFXI3DL2Reverb:=(-1000, -476, 0.0, 4.32, 0.59,  -789, 0.020,  -289, 0.030, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_CONCERTHALL     :constant DSFXI3DL2Reverb:=(-1000, -500, 0.0, 3.92, 0.70, -1230, 0.020,    -2, 0.029, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_CAVE            :constant DSFXI3DL2Reverb:=(-1000,    0, 0.0, 2.91, 1.30,  -602, 0.015,  -302, 0.022, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_ARENA           :constant DSFXI3DL2Reverb:=(-1000, -698, 0.0, 7.24, 0.33, -1166, 0.020,    16, 0.030, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_HANGAR          :constant DSFXI3DL2Reverb:=(-1000,-1000, 0.0,10.05, 0.23,  -602, 0.020,   198, 0.030, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY :constant DSFXI3DL2Reverb:=(-1000,-4000, 0.0, 0.30, 0.10, -1831, 0.002, -1630, 0.030, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_HALLWAY         :constant DSFXI3DL2Reverb:=(-1000, -300, 0.0, 1.49, 0.59, -1219, 0.007,   441, 0.011, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR   :constant DSFXI3DL2Reverb:=(-1000, -237, 0.0, 2.70, 0.79, -1214, 0.013,   395, 0.020, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_ALLEY           :constant DSFXI3DL2Reverb:=(-1000, -270, 0.0, 1.49, 0.86, -1204, 0.007,    -4, 0.011, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_FOREST          :constant DSFXI3DL2Reverb:=(-1000,-3300, 0.0, 1.49, 0.54, -2560, 0.162,  -613, 0.088,  79.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_CITY            :constant DSFXI3DL2Reverb:=(-1000, -800, 0.0, 1.49, 0.67, -2273, 0.007, -2217, 0.011,  50.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_MOUNTAINS       :constant DSFXI3DL2Reverb:=(-1000,-2500, 0.0, 1.49, 0.21, -2780, 0.300, -2014, 0.100,  27.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_QUARRY          :constant DSFXI3DL2Reverb:=(-1000,-1000, 0.0, 1.49, 0.83,-10000, 0.061,   500, 0.025, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_PLAIN           :constant DSFXI3DL2Reverb:=(-1000,-2000, 0.0, 1.49, 0.50, -2466, 0.179, -2514, 0.100,  21.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_PARKINGLOT      :constant DSFXI3DL2Reverb:=(-1000,    0, 0.0, 1.65, 1.50, -1363, 0.008, -1153, 0.012, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_SEWERPIPE       :constant DSFXI3DL2Reverb:=(-1000,-1000, 0.0, 2.81, 0.14,   429, 0.014,   648, 0.021,  80.0,  60.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_UNDERWATER      :constant DSFXI3DL2Reverb:=(-1000,-4000, 0.0, 1.49, 0.10,  -449, 0.007,  1700, 0.011, 100.0, 100.0, 5000.0);

   I3DL2_ENVIRONMENT_PRESET_SMALLROOM       :constant DSFXI3DL2Reverb:=(-1000, -600, 0.0, 1.10, 0.83,  -400, 0.005,   500, 0.010, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM      :constant DSFXI3DL2Reverb:=(-1000, -600, 0.0, 1.30, 0.83, -1000, 0.010,  -200, 0.020, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_LARGEROOM       :constant DSFXI3DL2Reverb:=(-1000, -600, 0.0, 1.50, 0.83, -1600, 0.020, -1000, 0.040, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL      :constant DSFXI3DL2Reverb:=(-1000, -600, 0.0, 1.80, 0.70, -1300, 0.015,  -800, 0.030, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_LARGEHALL       :constant DSFXI3DL2Reverb:=(-1000, -600, 0.0, 1.80, 0.70, -2000, 0.030, -1400, 0.060, 100.0, 100.0, 5000.0);
   I3DL2_ENVIRONMENT_PRESET_PLATE           :constant DSFXI3DL2Reverb:=(-1000, -200, 0.0, 1.30, 0.90,     0, 0.002,     0, 0.010, 100.0,  75.0, 5000.0);
    
    
   DS3DALG_DEFAULT:constant guid:=GUID_NULL;
    
    
private
   pragma Linker_options("C:\WINDOWS\system32\dsound.dll");
    
end dsound;
----------------------------------------
-- File : dsound.adb                  --
-- Translator:Dongfeng.Gu,2018/10/19  --
-- Mail: [email protected]                --
-- Progress:100%                      --
----------------------------------------

with interfaces.C;                use interfaces.C;
with ada.unchecked_conversion;

package body dsound is

   function MAKE_HRESULT(sev, fac, code : WORD) return win32.DWORD is
      USE TYPE Interfaces.C.unsigned_short;
      type QWORD is mod 2**64;
      for QWORD'SIZE USE 64;
      pragma warnings(off);
      --LARGE SIZE TO SMALL SIZE,GET THE LOWER PART--
      FUNCTION UC IS NEW ADA.UNCHECKED_CONVERSION(QWORD,win32.DWORD);
      pragma warnings(off);
   begin
      RETURN UC(QWORD(sev)*2**31 OR QWORD(fac)*2**16 OR QWORD(code));  
   end MAKE_HRESULT;

   function MAKE_DSHRESULT(code:win32.WORD) return win32.DWORD is
      FUNCTION MAKE_HRESULT(sev, fac, code : WORD) RETURN win32.DWORD is
         USE TYPE Interfaces.C.unsigned_short;
         type QWORD is mod 2**64;
         for QWORD'SIZE USE 64;
         pragma warnings(off);
         --LARGE SIZE TO SMALL SIZE,GET THE LOWER PART--
         FUNCTION UC IS NEW ADA.UNCHECKED_CONVERSION(QWORD,win32.DWORD);
         pragma warnings(off);
      begin
         RETURN UC(QWORD(sev)*2**31 OR QWORD(fac)*2**16 OR QWORD(code));  
      end MAKE_HRESULT;
   begin
      return MAKE_HRESULT(1, FACDS, code);
   end MAKE_DSHRESULT;
    
   function  DSSPEAKER_COMBINED(c:byte;g:byte) return DWORD is
   begin
      return DWORD(DWORD(c or g)*2**16);
   end DSSPEAKER_COMBINED;
 
   --generic
   function  DSSPEAKER_CONFIG(a:T) return byte is
      function uc is new ada.unchecked_conversion(T,BYTE);
   begin
      return UC(A);
   end DSSPEAKER_CONFIG;
    
   function DSSPEAKER_GEOMETRY(a:T) return BYTE is
      function uc is new ada.unchecked_conversion(T,DWORD);
      function uc is new ada.unchecked_conversion(DWORD,BYTE);
   begin
      return uc((uc(a)/2**16) or 16#00FF#);
   end DSSPEAKER_GEOMETRY;

end dsound;

猜你喜欢

转载自blog.csdn.net/adacore/article/details/83187131
今日推荐