admin管理员组文章数量:1323200
I have an electron app that uses the webkit speech recognition API. If tested in the browser, everything works as intended, but if run in the electron environment, the speech recognition api doesn't work.
What I mean is that when I press the button that starts the recording, the recording won't start in the electron environment. I believe that is because unlike when running the code in the browser, I wasn't asked for and therefore not granted microphone access. So my question is then, how can I request access for the microphone in an electron app? Thanks in advance!
I have an electron app that uses the webkit speech recognition API. If tested in the browser, everything works as intended, but if run in the electron environment, the speech recognition api doesn't work.
What I mean is that when I press the button that starts the recording, the recording won't start in the electron environment. I believe that is because unlike when running the code in the browser, I wasn't asked for and therefore not granted microphone access. So my question is then, how can I request access for the microphone in an electron app? Thanks in advance!
Share Improve this question asked Jun 22, 2019 at 8:45 Adrian PascuAdrian Pascu 1,0397 gold badges25 silver badges54 bronze badges1 Answer
Reset to default 4Found this in the electron docs. https://electronjs/docs/api/system-preferences#systempreferencesaskformediaaccessmediatype-macos
If you're using macOS to run the app use that method to request permission. If not it doesn't look like the app requires permission to use the microphone or camera.
本文标签: javascriptRequest microphone permission in electronStack Overflow
版权声明:本文标题:javascript - Request microphone permission in electron - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742099210a2420722.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论