在Windows上使用音频检测进程 [英] Detect Processes using Audio on Windows

查看:129
本文介绍了在Windows上使用音频检测进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检测Windows机器上正在播放音频的进程?换句话说,如何枚举正在使用声卡的进程?

How do I detect which processes are playing audio on my Windows machine? In other words, how do I enumerate processes which are using my sound card?

推荐答案

在Windows 7上,有一些API可以让您枚举计算机上的所有音频会话,您可以使用它们来枚举当前(或最近播放过的音频.

On Windows 7, there are APIs that will allow you to enumerate all the audio sessions on the machine, you can use these to enumerate the processes which are currently (or have recently) played audio.

对此有一些严重的警告.例如,您无法使用ASIO等第三方音频堆栈来发现应用程序,也无法检测到呈现压缩音频的应用程序(使用独占模式).但是对于很大一部分(98%?)的应用程序,您可以使用IAudioSessionManager2接口检索会话枚举器,这将使您枚举以共享方式呈现(或最近呈现)音频的应用程序.

There are some serious caveats to this. For instance you can't discover applications using 3rd party audio stacks like ASIO and you can't detect applications rendering compressed audio (using exclusive mode). But for a significant (98%?) of the apps, you can use the IAudioSessionManager2 interface to retreive a session enumerator which will let you enumerate the apps which are rendering (or have rendered recently) audio in shared mode.

不幸的是,此功能仅适用于Windows 7.

Unfortunately this functionality is Windows 7 only.

这篇关于在Windows上使用音频检测进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆