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 language.
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.