How to toggle microphone on and off using python

2019-09-05 15:47发布

I am wondering if there is a way to use python to mute and microphone? I am working on a project that requires the Microphone setting to be set to "Listen to this device". However, to prevent the Microphone from picking up unwanted noise from a TV or radio, I need a way to toggle between Mute and Unmute through a python script.

1条回答
做自己的国王
2楼-- · 2019-09-05 15:58

PyAudio is one cross-platform option for this. It's more than just direct access to the audio device controls, so it's moderately complicated to use. pymedia is another option, the pymedia.audio.sound package provides access to the mixer devices which is where the controls for the microphone (input level, mute etc.) would be.

查看更多
登录 后发表回答