Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PolicyConfig class to manipulate Windows audio devices #398

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

PolicyConfig class to manipulate Windows audio devices #398

wants to merge 1 commit into from

Conversation

astutejoe
Copy link

This class enables the programmer to manipulate Windows settings for audio devices, such as the default device for each role. It's rather messy due to the fact that the COM Interface IID changes with a considerable frequency, hence we need to try to support every possibility, falling back to an unknown interface (https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dcom/2b4db106-fb79-4a67-b45f-63654f19c54c) as a last resort. This class is basically a mashup of many different implementations of the same feature across public repositories, extracting, to my best judgment, the best of each. It's most probably not following the project code standards so I'm kinda expecting for someone to help me on that :)

Sorry for any inconvenience!

This class enables the programmer to manipulate Windows settings for audio devices, such as the default device for each role. It's rather messy due to the fact that the COM Interface IID changes with a considerable frequency, hence we need to try to support every possibility, falling back to an unknown interface (https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dcom/2b4db106-fb79-4a67-b45f-63654f19c54c) as a last resort. This class is basically a mashup of many different implementations of the same feature across public repositories, extracting, to my best judgment, the best of each. It's most probably not following the project code standards so I'm kinda expecting for someone to help me on that :)

Sorry for any inconvenience!
@filoe
Copy link
Owner

filoe commented Dec 12, 2019

Thanks for your pull request.
I have faced the same problem while implementing xaudio (see

private static IntPtr CreateXAudioInstance(bool debug)
)
CSCore uses a special way of using com interfaces. I've wrote an article a few years ago: https://www.codeproject.com/Articles/644130/NET-COM-Interop-using-Postbuild
The mentioned post compiler is already built into cscore.

I would suggest to implement this the same way.
If you need any help or advice, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants