Open JackDotJS opened 2 years ago
will need to find a different solution since we are no longer using electron
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.
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
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.
https://github.com/almoghamdani/audify
found through this thread: https://github.com/electron/electron/issues/13771