山顶米,在Windows个别项目7 [英] Peak meters for individual programs on Windows 7

查看:264
本文介绍了山顶米,在Windows个别项目7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

时有可能获得在Windows 7上个别项目的高峰仪表读数,如果是这样,怎么样?

Is it possible to obtain the peak meter readings for individual programs on Windows 7, and if so, how?

使用WASAPI可以捕获通过一个回送设备的整个系统的音频,但是这并不从不同的程序输出之间区分。 <一href=\"http://stackoverflow.com/questions/6084550/capture-audio-of-a-single-application-on-windows-7\">This问题捕捉方面为一个指定的应用程序的音频,但获取了单独播放音频的所有程序打交道时,答案似乎望而却步。这必须是可能的,因为SndVol可以做到这一点,如下图所示的图像中。现在的问题是怎么回事正在完成的?难道正在通过未曝光的API调用完成或它实际上有可能通过WASAPI实现这样的事情呢?

With WASAPI one can capture the entire system audio through a loopback device, but this does not differentiate between outputs from different programs. This question regards capturing audio for a single specified application, but the answers seem prohibitive when dealing with capturing all programs that are playing audio individually. This must be possible because SndVol can do it, as shown in the image below. The question is how is it being accomplished? Is it being done through unexposed API calls or is it actually possible to achieve something like this through WASAPI as well?

感谢。

推荐答案

您列举音频会议,并获得 IAudioSessionControl 接口(MSDN的 code段)。缺少的部分是,你可以查询从 IAudioSessionControl IAudioMeterInformation inteface你已经持有。

You are enumerating audio sessions and getting IAudioSessionControl interfaces (MSDN code snippet). The missing part is that you can query IAudioMeterInformation inteface from IAudioSessionControl you are already holding.

如果音频端点支持峰值米,你就能获得这个接口,并使用 IMeterInformation :: GetPeakValue 个人会议。而这也正是所谓SndVol做。

If the audio endpoint supports peak meters, you will be able to obtain this interface, and use IMeterInformation::GetPeakValue for individual sessions. And this is what SndVol supposedly doing.

下面是一个<一个href=\"http://www.alax.info/trac/public/browser/trunk/Utilities/Miscellaneous/AudioSessionVolumeNotification/AudioSessionVolumeNotification.cpp#L74\"相对=nofollow>片code,做的东西的:

CComPtr<IAudioSessionControl> pSessionControl;
...
CComQIPtr<IAudioMeterInformation> pMeterInformation = pSessionControl;
FLOAT fPeakValue;
pMeterInformation->GetPeakValue(&fPeakValue);
_tprintf(_T("nSessionIndex %d, fPeakValue %.2f\n"), nSessionIndex, fPeakValue);

这篇关于山顶米,在Windows个别项目7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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