You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Could not start audio source error on mediaDevices.getUserMedia #32299
I found the caveats about this restriction on the Electron official docs
navigator.mediaDevices.getUserMedia does not work on macOS for audio capture due to a fundamental limitation whereby apps that want to access the system's audio require a signed kernel extension. Chromium, and by extension Electron, does not provide this.
It is possible to circumvent this limitation by capturing system audio with another macOS app like Soundflower and passing it through a virtual audio input device. This virtual device can then be queried with navigator.mediaDevices.getUserMedia.
I am also having the same issue, it works perfectly fine on windows but on Ubuntu it does not work, the regular microphone can be assessed but anything from desktopCapturer.getSources does not work. Electron Version:
22.0.0
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!
This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.
Ive spend 2 days on this, and still no solution to this, It always throws the same error, could not start audio. But it does not even start video const stream = await navigator.mediaDevices .getUserMedia({ audio: true, video: { width: { max: 1080, }, }, }) .then( (st) => { videoRef.src = st; setMyStream(st); }, (err) => { console.log(err); } );
Activity
[-][Bug]: [/-][+][Bug]: Could not start audio source error on mediaDevices.getUserMedia[/+]TheRafaelFarias commentedon Mar 10, 2022
Some update on this? Its march and nobody said anything
I tried with electron 14.2.6, 15.4.0 and the 17.1.1, none of them worked, same error
Shubham-Kumar-2000 commentedon Mar 10, 2022
Yes I got a solution.
Its basically a workaround.
First execute this on installation :
Then in your
rendererprocess :Finally in the
mainprocess :Well I haven't completed the
macOSimplemention yet thus have excluded that.TheRafaelFarias commentedon Mar 11, 2022
Didn't worked for me.
await navigator.mediaDevices.enumerateDevices();only returns the camera and the audio and not the applicationskei49 commentedon Sep 12, 2022
I faced the same errors on MacOS Big Sur Version 11.6.8 with electron 20.0.3. Any solutions?
kei49 commentedon Sep 12, 2022
I found the caveats about this restriction on the Electron official docs
https://www.electronjs.org/docs/latest/api/desktop-capturer#caveats
PDKSophia commentedon Dec 27, 2022
I have the same problem,does anyone have a solution?
Electron Version
21.3.0
My Code
It doesn't work instead gives error :
wreper12 commentedon Jan 11, 2023
I am also having the same issue, it works perfectly fine on windows but on Ubuntu it does not work, the regular microphone can be assessed but anything from desktopCapturer.getSources does not work.
Electron Version:
22.0.0
github-actions commentedon Apr 11, 2023
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!
github-actions commentedon May 11, 2023
This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.
Lalg28 commentedon Jun 29, 2023
I'm already having the same error with Electron 22.0.0 and MacOS Ventura 13.2 🥲
vvillaluna commentedon Aug 16, 2023
Having same error here but it's working fine on other machines. It might have to do something on the hardware or audio drivers installed on a machine.
akshiii commentedon Mar 2, 2024
Ive spend 2 days on this, and still no solution to this, It always throws the same error, could not start audio. But it does not even start video
const stream = await navigator.mediaDevices .getUserMedia({ audio: true, video: { width: { max: 1080, }, }, }) .then( (st) => { videoRef.src = st; setMyStream(st); }, (err) => { console.log(err); } );