mdonoughe / sbz-switch

Utility for switching Sound Blaster outputs on Windows
Apache License 2.0
43 stars 5 forks source link

Requires update to the SoundCore CLSID to work with other cards #4

Closed enslen closed 2 years ago

enslen commented 2 years ago

Hello Matthew,

First off, thank you for this. I love this. I found it randomly and use it for toggling my speakers/headphones. I have an SBZ and it works great. I recently posted this on the SoundBlaster sub and recommended it as an option for anyone looking for this functionality without having to do mouse/keyboard manipulation (with AHK or other). Someone there tried to use it with an AE-5 and could not get it to work (SoundCore not supported error). Turns out the SoundCore CLSID is tied to the driver so the AE-5 does not work...unless you change the SoundCore CLSID in the code (consts.rs). I went ahead and changed the CLSID and recompiled...and voila, it worked for the person in question.

My change:

DEFINE_PROPERTYKEY! {PKEY_SOUNDCORECTL_CLSID, 0xd8570091, 0xaf3f, 0x4615,0x9f, 0xaa, 0xa2, 0x48, 0x45, 0xd1, 0x09, 0x36, 0}

Not sure if you want to expand the code to account for multiple cards but it would be nice. Alternatively, you could even set a parameter to override the CLSID (if there are other CLSIDs for other Creative cards that utilize SoundCore) so then you don't have to account for each CLSID.

Thanks again! I appreciate your work on this.

Richard

mdonoughe commented 2 years ago

Thanks for the CLSID property. It's not actually the CLSID, but a ID of a property containing the CLSID. I don't know why they would use different properties for this. It seems like that just makes the code more complicated.

The version attached at the bottom of this page should work for AE-5, and maybe other cards that did not previously. https://github.com/mdonoughe/sbz-switch/actions/runs/2288227531