NAudio icon indicating copy to clipboard operation
NAudio copied to clipboard

Rerouting application output to selected device

Open lentrodev opened this issue 7 years ago • 6 comments

Hi. I would like to reroute output of some applications to selected device. For example the output from game to headphones, output from browser to loudspeakers, etc. How I can realize that idea, and this possible with this library or not?

lentrodev avatar Apr 10 '18 18:04 lentrodev

No, I'm afraid that's not possible with NAudio. You'd need a virtual audio driver to be able to do that.

markheath avatar Apr 11 '18 08:04 markheath

@markheath Isn't is possible in Windows 10? They added an interface to assign application to audio devices in Settings. I'd love to be able to do this programmatically using NAudio. Isn't there a way to re-assign Session to another EndPoint?

anmiles avatar Sep 18 '19 13:09 anmiles

It's not something I'm aware of, but it is of course quite possible that there are new WASAPI interfaces that support this. If there are, then perhaps we could create interop wrappers for them.

markheath avatar Sep 24 '19 10:09 markheath

maybe he wants something like audiorouter but available as a nugget package. it would be neat to have an app router like this in NAudio

jwallet avatar Jan 20 '20 01:01 jwallet

Looks a really interesting project - I've not seen it before. Maybe that could be done in C# - would need to dive into the implementation in more detail

markheath avatar Jan 20 '20 10:01 markheath

it works, I did use the solution from SoundDeck, SoundDeck also uses nAudio.

commit: https://github.com/jwallet/spy-spotify/commit/6d428a62025ae41ef6ebbe1a671544dc2cf948aa note: MainAudioSession.cs - it's where I added the functionnality "AudioRouter" to perform audio routing

So, it's possible to reroute other app audio session to another audio device

jwallet avatar Apr 21 '22 02:04 jwallet