简体   繁体   English

如何知道我连接的麦克风是否被任何用户使用? (Python 或 Linux x84-64)

[英]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)

On Debian, see also hwinfo .在 Debian 上,另请参见hwinfo

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的程序有没有办法检测我的麦克风是否被任何程序使用? (视窗 10) - Is there a way my program can detect if my microphone is being used by any programs? (Windows 10) 我怎么知道用户是否通过python脚本中的ssh连接到本地计算机? - How can I know if the user is connected to the local machine via ssh in my python script? 我如何获得 Python 以了解用户连接的 Wifi? - How do I get Python to know what Wifi the user is connected to? 在python中我怎么知道给定的文件正在使用 - In python how can i know a given file is being used 如何知道Python当前使用的是哪个GPU器件? - How to know which GPU device is currently being used in Python? Python:如何确定正在使用的特定 Linux 发行版? - Python: How to determine the specific Linux distribution being used? 在 linux 上,如何允许任何用户写入文件,但只能通过运行我的(python)脚本? - On linux, how can I allow any user to write to a file, but only by running my (python) script? 如何让 anaconda 使用安装在我的系统上的 python3.9.2(64 位),但 Anaconda 将 python 3.8.8(32 位)作为默认使用? - How can I make anaconda use python3.9.2(64 bit) which is installed on my system but Anaconda gives python 3.8.8(32 bit) as default being used? 测试麦克风Linux命令或python - Testing Microphone Linux command or python Python:如何连接蓝牙设备? (Linux) - Python: How to get connected bluetooth devices? (Linux)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM