node-audio-windows icon indicating copy to clipboard operation
node-audio-windows copied to clipboard

add support for switching audio endpoints

Open whitmer opened this issue 6 years ago • 2 comments

This is a great tool, I'm excited to build it and start using it in my electron app. Is is possible to extend this to allow for switching between audio endpoints? I work with disabled folks on a speech-generating app, and they want to be able to toggle between audio going to their headset and the device speakers. I've been digging around in the Windows APIs and haven't made much progress on my own, otherwise I'd offer a pull request :-).

whitmer avatar Feb 08 '19 18:02 whitmer

Just to update, I've been playing with defsound (https://archive.codeplex.com/?p=defsound) and a derived library called AudioEndPointLibrary (https://github.com/Belphemur/AudioDefaultSwitcher) which seem to use the strategy defined here:

https://stackoverflow.com/questions/13054371/programmatically-switch-audio-devices-on-windows-7

which works great on my devices. I'm going to play with it some more in the hopes of getting it working, but my c++ skills are pretty rusty so if you have a chance to look at it I'm supremely confident you will have a faster/more elegant solution :-).

whitmer avatar Feb 08 '19 19:02 whitmer

That trick is done by using an undocumented Windows-API. To make it work on Windows 10 you need to do even more hacks so I would be cautious adding such feature.

jlonardi avatar Feb 12 '19 10:02 jlonardi