Java – how do I detect which program plays sound on Windows 7?

I'm trying to write a small background program that will prevent music from playing Winamp. Com when another program plays sound The part about accessing Winamp through Java has been solved. Now I need a method to detect which program plays the currently playing sound (maybe I want some programs to play their sound without stopping my music) Although I do this in Java (win API), everything in any language will help

[editor] because I just got the first question on the first question, here are some more detailed information: I have figured out how to use WinAPI (but I don't know it) and capture volume, volume and so on There are still problems with the detection of the origin of the mentioned sound and which program plays the sound Is there anything in WinAPI that can help me do this? [/ edit]

Solution

As Deanna said, you can enumerate audio playback sessions, just like the volume mixer application (launched from the system tray icon), and obtain per session meters indicating the session status

In this answer, you can find the C application that performs this operation: peak meters for individual programs on Windows 7 The meter is per session. An audio enabled application may contain one or more sessions, but in the end, as long as you enumerate them, you can determine that there is any valid playback there

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>