开发者

How do I detect if the computer is playing any sound?

开发者 https://www.devze.com 2023-04-08 14:56 出处:网络
I want to programmatically detect if a (local) computer (not mobile device) is playing any sound or music. Preferably via some high level api from Java or Python or a similar l开发者_JAVA技巧anguage.I

I want to programmatically detect if a (local) computer (not mobile device) is playing any sound or music. Preferably via some high level api from Java or Python or a similar l开发者_JAVA技巧anguage.


I have never done it, but as a first approach I would open (open as input, not output) a fake recording stream on the master windows playback lineout device (instead the normal use of opening the mic or linein device for recording).

I would then monitor the captured frames. If for a certain time there are values over some small threshold, I would infer there is sound.

0

精彩评论

暂无评论...
验证码 换一张
取 消