Visual Studio Code 的 Mac OS Mojave 麦克风权限 [英] Mac OS Mojave microphone permission for Visual Studio Code

查看:24
本文介绍了Visual Studio Code 的 Mac OS Mojave 麦克风权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 PyAudio 录制音频,但是在 VSCode 中工作时没有生成麦克风权限请求.

I'm trying record audio with PyAudio however when working in VSCode no microphone permission request is generated.

我已经完成了 NVRAM 重置,这允许我通过终端运行脚本(在它生成权限请求之后).

I have done an NVRAM reset which allowed me to run the script though the terminal (after it generated a permission request).

在隐私设置中,唯一可用的应用程序是 Chrome 和终端,因此无法在此处授予 VSCode 权限.

Within the privacy settings the only apps available are Chrome and Terminal, so it is not possible to give VSCode permission here.

有没有办法对 VSCode 强制请求权限?或者以其他方式编辑麦克风权限?

Is there a way to force a permission request for VSCode? Or somehow otherwise edit the microphone permissions?

推荐答案

VScode 可能有一个 bug,它在需要时似乎没有请求权限.尝试使用 xlwings(操作系统是 Catalina)创建 Excel 电子表格时,我遇到了类似的问题.我发现了一个相关的 github ticket #95062 说 VScode 不要求权限访问媒体设备.

VScode may have a bug in that it doesn't seem to request permissions when needed. I'm facing a similar problem when trying to create an Excel spreadsheet using xlwings (OS is Catalina). I found a related github ticket #95062 saying VScode doesn't ask for permissions to access media devices.

我可以通过从终端 sudo/Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron 启动具有管理员权限的 VScode 来绕过请求权限的需要.我还可以从具有正常权限的终端运行我的 xlwings 代码,因为终端在预期时请求了所需的权限.PyCharm 在用于运行相同的 xlwings 代码时也要求获得许可,这加强了我的信念,即这是 VSCode 中的权限请求错误.

I can bypass the need for requesting permissions by launching VScode with admin permissions from terminal sudo /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron. I can also run my xlwings code from terminal with normal permissions because terminal requested the needed permissions when expected. PyCharm also asked for permission when used to run the same xlwings code, which reinforces my belief that it's a permissions request bug in VSCode.

这篇关于Visual Studio Code 的 Mac OS Mojave 麦克风权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆