检查应用程序发出的声音 [英] Check if an application emits sound
问题描述
今天我在这里问你怎么可以的了解的如果给定的应用程序发出的声音。
在Windows 7和8我用下面的code(库 CSCore音频 )
today I am here to ask you how you can "understand" if a given application is emitting sound. On windows 7 and 8 I use the following code (library CSCore Audio )
[...]
AudioSessionManager2 sessionManager = GetDefaultAudioSessionManager2(DataFlow.Render);
AudioSessionEnumerator sessionEnumerator = sessionManager.GetSessionEnumerator();
AudioSessionControl2 sessionControl;
foreach (AudioSessionControl session in sessionEnumerator)
{
sessionControl = session.QueryInterface<AudioSessionControl2>();
if (sessionControl.Process.MainWindowTitle.StartsWith("my_test"))
{
sessione = sessionControl;
audio = session.QueryInterface<AudioMeterInformation>();
break;
}
}
control.Text = sessione.Process.MainWindowTitle + "[" + audio.PeakValue + "]";
[...]
它运作良好,但Windows XP。
有没有办法的通用的办呢?
如果将有一个办法做到这一点在Java中甚至会更好,所以在Linux上使用(这对于此刻我不需要,但也许在未来)
It works well, but not on Windows XP. Is there a way "universal" to do it? If there would be a way to do this in Java would be even better, so work on Linux (which for the moment I do not need, but maybe in the future)
推荐答案
我很抱歉,但Windows XP不查询进程的音频峰值。您还可以看看在的Windows XP音频混音器。没有显示高峰。
I am sorry, but Windows XP does not querying the audio peak of a process. You can also take a look at the Windows XP Audio Mixer. There is no peak displayed.
这篇关于检查应用程序发出的声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!