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

Switch process to another device #5

Open
KillerBOSS2019 opened this issue Mar 12, 2022 · 10 comments
Open

Switch process to another device #5

KillerBOSS2019 opened this issue Mar 12, 2022 · 10 comments

Comments

@KillerBOSS2019
Copy link

Hi, Thanks for the awesome library. I am curious if there any way to route process to another device? In Win10 under mixer you can see that your able to change app's output/input device.

@kdschlosser
Copy link
Owner

I am not sure what you mean.

@kdschlosser
Copy link
Owner

kdschlosser commented Mar 12, 2022

I also have a newer version of the library that runs on python 3. I also reworked the API so it's much easier to use. I also fixed some memory leaks as well.

It's in the develop branch

@KillerBOSS2019
Copy link
Author

image
You see discord have audio output

@KillerBOSS2019
Copy link
Author

I want to be able to switch Output device per application

@kdschlosser
Copy link
Owner

you want to be able to control the volume of another application?

I haven't tried doing that. if you register to get a callback for a stream being created/destroyed you might be able to change the volume of the stream. I would have to mess about with it to see if it can be done.

@KillerBOSS2019
Copy link
Author

you want to be able to control the volume of another application?

I haven't tried doing that. if you register to get a callback for a stream being created/destroyed you might be able to change the volume of the stream. I would have to mess about with it to see if it can be done.

Well change the output device of each application

@kdschlosser
Copy link
Owner

The only way you can alter the output device is if you set the application to use the default audio endpoint and then using this library you would change the default audio endpoint to whatever it is you want the audio to be output from.

Unfortunately there is no API to redirect another programs audio output to a different endpoint.
Now I am not saying there is a way as I am sure there is, I believe you can do what you are looking to do by using the loopback sound device and looping the audio back and then send it back out to the endpoint you want. Problem is Python is simply too slow to be able to do this.

@KillerBOSS2019
Copy link
Author

The only way you can alter the output device is if you set the application to use the default audio endpoint and then using this library you would change the default audio endpoint to whatever it is you want the audio to be output from.

Unfortunately there is no API to redirect another programs audio output to a different endpoint. Now I am not saying there is a way as I am sure there is, I believe you can do what you are looking to do by using the loopback sound device and looping the audio back and then send it back out to the endpoint you want. Problem is Python is simply too slow to be able to do this.

I found this It seems like there is a way using policyconfig https://github.com/Belphemur/SoundSwitch/blob/4ae9d0c6a8dc7cb2f7cf62d8ab8d8ca11d50830c/SoundSwitch.Audio.Manager/AudioSwitcher.cs#L109

@kdschlosser
Copy link
Owner

OK that is only going to work on Windows 10 version 1803 or newer.

I am looking into it because I am not able to locate the class ids in my registry nor can I locate the the .NET class "Windows.Media.Internal.AudioPolicyConfig".

I have added code to see if I can get it to work. we will see what happens.

@KillerBOSS2019
Copy link
Author

Any luck on this?

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

No branches or pull requests

2 participants