Advertisement
Kitomas

_kit_w32_audioX2.h

Jul 21st, 2023
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.60 KB | Source Code | 0 0
  1. //link kernel32, Ole32, and xaudio2 to use
  2. #ifndef _KIT_W32_AUDIOX2_H
  3. #define _KIT_W32_AUDIOX2_H
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9.  
  10.  
  11. #ifndef WINDOWS_LEAN_AND_MEAN
  12. # define WINDOWS_LEAN_AND_MEAN
  13. #  include <windows.h>
  14. # undef WINDOWS_LEAN_AND_MEAN
  15. #else
  16. #  include <windows.h>
  17. #endif
  18. //#include <windef.h>
  19. //#include <winnt.h>
  20. //#include <initguid.h>
  21. //#include <audioclient.h>
  22. //#include <mmdeviceapi.h>
  23. #include <xaudio2.h>
  24. #include <synchapi.h>
  25.  
  26.  
  27. #include <_kit_w32_privmacro.h>
  28.  
  29.  
  30.  
  31. typedef struct {
  32.   CRITICAL_SECTION        lock;
  33.   IXAudio2*               object;
  34.   IXAudio2MasteringVoice* master;
  35.   IXAudio2SourceVoice**   sources;
  36.   void**                  sources_spec;
  37.   unsigned int            sources_len;
  38.   unsigned int           _padding; //might use this for something later
  39. } _kit_audioX2_Engine;
  40.  
  41.  
  42.  
  43. //--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//
  44.  
  45. extern HRESULT _kit_audioX2_CreateVoice(_kit_audioX2_Engine* engine, const WAVEFORMATEX* source_format, unsigned int* index_p);
  46.  
  47.  
  48. extern HRESULT _kit_audioX2_DestroyVoice(_kit_audioX2_Engine* engine, unsigned int index);
  49.  
  50.  
  51.  
  52. //--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//
  53.  
  54. extern HRESULT _kit_audioX2_CreateEngine(_kit_audioX2_Engine** engine_p,
  55.                                          const WAVEFORMATEX* source_format,
  56.                                          const wchar_t* deviceID);
  57.  
  58.  
  59. extern HRESULT _kit_audioX2_DestroyEngine(_kit_audioX2_Engine** engine_p);
  60.  
  61.  
  62.  
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66.  
  67. #endif /* _KIT_W32_AUDIOX2_H */
  68.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement