JackDotJS / node-studio

Node-based music production tool, built with Tauri.
MIT License
9 stars 1 forks source link

Option to output audio to non-default audio devices #10

Open JackDotJS opened 2 years ago

JackDotJS commented 2 years ago

https://github.com/almoghamdani/audify

found through this thread: https://github.com/electron/electron/issues/13771

JackDotJS commented 1 year ago

will need to find a different solution since we are no longer using electron

JackDotJS commented 1 year ago

this might be possible with built-in web APIs.

https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/setSinkId

only issue is that it explicitly requires the user to give permission via a lil popup before we can access this data. awesome for privacy reasons, but it does add an extra step for the end user and could come off as slightly jarring and annoying. most people probably wouldn't expect to have to give permission like that for most desktop applications.

on the bright side, it seems the user would only have to give permission once.

JackDotJS commented 1 year ago

also worth noting getUserMedia() grants microphone access as well, which could be used for recording instrument/voice samples and stuff. so there's a good chance we'll be using this API either way

JackDotJS commented 1 year ago

last comment i promise

another issue is that if the user were to deny the permission, we will not be able to ask again, ever.

on regular browsers, this can be fixed by going into settings and removing the given website from a "permissions blacklist". but i have absolutely no idea if or how you could do this in the context of OS native web renderers that Tauri uses.