20180210 - WaveRT Made Simple


This is a rough outline on how I'm using WaveRT in the Low-Dependency Vulkan Engine (LDVE). Showing just playback here. When LDVE is finished the full source will be available.


 // Given filter handle 'h' return number of pins, with 4 as default on error.
 S_ U4 AudOpenPins(U8 h){
  S_ KSP_PIN k={{{{{/* KSPROPSETID_Pin */ 0x8C134960,0x51AD,0x11CF,{0x87,0x8A,0x94,0xF8,0x01,0xC1,0x00,0x00}},
   KSPROPERTY_PIN_CTYPES,KSPROPERTY_TYPE_GET}}},0,0};
  U4 c=4;U4 t;DeviceIoControl(h,IOCTL_KS_PROPERTY,&k,sizeof(k),&c,sizeof(c),&t,0);return c;}


 S_ KSPIN_CONNECT_KSDATAFORMAT_WAVEFORMATEX audConnect=
  {/* KSPIN_CONNECT_KSDATAFORMAT_WAVEFORMATEX */
   {/* KSPIN_CONNECT */
    {{{/* Interface */
     {/* KSINTERFACESETID_Standard */ 0x1A8766A0,0x62CE,0x11CF,{0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00}},
      KSINTERFACE_STANDARD_LOOPED_STREAMING,0}}},
    {{{/* Medium */
     {/* KSMEDIUMSETID_Standard */ 0x4747B320,0x62CE,0x11CF,{0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00}},
      KSMEDIUM_TYPE_ANYINSTANCE,0}}},
    0,0,{KSPRIORITY_NORMAL,1}},
   {/* KSDATAFORMAT_WAVEFORMATEX */
    {/* KSDATAFORMAT */ sizeof(KSDATAFORMAT_WAVEFORMATEX),0,4,0,
     {/* MajorFormat=KSDATAFORMAT_TYPE_AUDIO */ 0x73647561,0x0000,0x0010,{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}},
     {/* SubFormat=KSDATAFORMAT_SUBTYPE_PCM */ 0x00000001,0x0000,0x0010,{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}},
     {/* Specifier=KSDATAFORMAT_SPECIFIER_WAVEFORMATEX */ 0x05589f81,0xc356,0x11ce,{0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a}}},
    {/* WAVEFORMATEX */ WAVE_FORMAT_PCM,2,44100,44100*4,4,16,0}}};