[英]How to know if my connected microphone is being used by any user? (Python OR Linux x84-64)
I'm writing a program and I need to be notified if the microphone connected to my system is used by any program.我正在编写一个程序,如果任何程序使用连接到我的系统的麦克风,我需要得到通知。 Is there a way to do this in Linux or Python?
有没有办法在 Linux 或 Python 中做到这一点?
By the way, my microphone is connected via a USB cable and it is basically a webcam that has a microphone in it.顺便说一句,我的麦克风是通过 USB 电缆连接的,它基本上是一个带有麦克风的网络摄像头。
If your microphone is some /dev/media0
on Linux, you could use lsof
from https://github.com/lsof-org/lsof to find the processes using it.如果您的麦克风是 Linux 上的某个
/dev/media0
,您可以使用https://github.com/lsof-org/lsof中的lsof
来查找使用它的进程。 See also proc(5) and lsusb(8)另见proc(5)和lsusb(8)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.