Closed StayBlue closed 6 months ago
Thanks for letting me know, I'll try firefox 101 when I have time.
Script fails due to assuming a 'default' device exists if you don't use the virtmic thing, which it doesn't on Firefox; And if the id is undefined it picks the first available mic, and if it's the same as your mic it leads to Firefox collapsing the captures into one, meaning you can't change what the stream captures.
enumerateDevices's ordering is meaningful, that is the first device is your default mic, which you're the most likely to use in Discord, leading to the scenario above.
I'd make a PR for this, but this repo doesn't contain the actual script, so... Around line 35:
catch (error) {
// id = "default";
await navigator.mediaDevices.enumerateDevices().then(devices => {id = devices[devices.length-1].deviceId});
}
Be careful with that as it can select your desktop audio, leading to a loopback while you hear your own stream, however it didn't get loud for me, for whatever reason.
By the way, is there source code on the virtmic binary? nvm, i'm blind
Script fails due to assuming a 'default' device exists if you don't use the virtmic thing, which it doesn't on Firefox; And if the id is undefined it picks the first available mic, and if it's the same as your mic it leads to Firefox collapsing the captures into one, meaning you can't change what the stream captures.
enumerateDevices's ordering is meaningful, that is the first device is your default mic, which you're the most likely to use in Discord, leading to the scenario above.
I'd make a PR for this, but this repo doesn't contain the actual script, so... Around line 35:
catch (error) { // id = "default"; await navigator.mediaDevices.enumerateDevices().then(devices => {id = devices[devices.length-1].deviceId}); }
Be careful with that as it can select your desktop audio, leading to a loopback while you hear your own stream, however it didn't get loud for me, for whatever reason.
~By the way, is there source code on the virtmic binary?~ nvm, i'm blind
default only exists on chromium browsers, the script is going to need few edits to be usable with firefox. We will need to enumeratedevices and pick a monitor probably since we must use a different device then the one discord uses as a mic.
Firefox 101 has just been released (on the 31st), and I can confirm that the new multiple microphone capture functionality works.
I was successful (with some caveats, see later) on the following setup:
There were a couple of problems, though:
navigator.mediaDevices.chromiumGetDisplayMedia
never gets set, or a permission error on attempting screensharenavigator.mediaDevices.chromiumGetDisplayMedia
never gets setOkay, I've definitely spent way too long getting this to work for me personally, so I suppose I'll share what I did.
I used the Firefox script changing every instance of audio: true
to audio: {autoGainControl: false, echoCancellation: false, noiseSuppression: false}
and everything appears to be working beautifully.
This does fix the previous comment's issue of audio quality, as this properly applies everywhere. However, this solution is not without its own problems:
just checking in, has there been any progress on this?
just checking in, has there been any progress on this?
I haven't had time to test this yet, however I'm hopeful I'll be able to fix firefox within this month.
I checked firefox, the script works out of the box with violentmonkey as long as you have virtmic up and running. There audio issues however, it sounds like playing a vinyl record at inconsistent speed. I will have to check whether firefox has any additional flags that modify audio,
One issue I found out is that the first microphone capture is listed as AudioCallbackDriver while the second as input-only stream
There audio issues however, it sounds like playing a vinyl record at inconsistent speed.
Is there any update on this? Been screen sharing through Chromium with audio with zero issues up until recently but some update seems to have broken video encode on Chromium for me (even with the script off), practically locking the screen share at 1 FPS. Firefox has great performance as usual but still seems to have the audio distortion issue up to this point and unfortunately, just as you've pointed out in the readme, no one seems to have documented this issue outside of this repository.
Here's a WIP build of Firefox that fixes this issue.
That's cool, is there a list of PRs to watch?
The audio pitching bug is now fixed in the nightly branch of Firefox. This is set to release to the stable branch on December 5th!
The audio pitching bug is now fixed in the nightly branch of Firefox. This is set to release to the stable branch on December 5th!
I'll keep the issue open until then, when it is released on the stable channel I'll close it and update the readme with a pr
Bit late to point out because I forgot the exact date/update that the relevant fix would come in, but I can confirm that audio no longer seems to be distorted in screenshares. Weirdly, I still have the other issue mentioned of the stream audio getting played back to you on regular Firefox whereas the issue does not exist on developer edition (ironically however this helped me confirm on my end that the issue is fixed, as before the fix I could also hear the distortion in the playback). Not sure if it's a difference in configuration I've overlooked or if there's actually something different in the builds, but for now I'm continuing to stick with developer edition for convenience.
Are there 0 issues left on stable Firefox?
From testing a bit earlier today audio seems to be working on normal Firefox with no audio looping back to myself.
Thank you
The issue mentioned in README has now been fixed by Mozilla (see here). While the fix isn't yet available in the latest stable release of Firefox (or at least I am fairly sure it isn't), the README should be updated to reflect the issue being fixed.