我如何获得信息从IMMDevice的? [英] How do I get information out of IMMDevice?
问题描述
我的问候IMMDevice一个完整的初学者,我要问什么好,简单的方法来得到一些设备出来的信息出来它是。在我的计划,我已经成功地设置一个指向那些GetDefaultAudioEndpoint之一()。现在我只需要能够获得一些基本信息出来,像一些音箱信息或扬声器或类似的东西的ID。什么是可以做到这一点,总初学者将能够拿起一个好办法吗?谢谢!
I'm a complete beginner with regards to IMMDevice, and I need to ask what a good, easy way to get some device out of information out of it is. In my program, I've already successfully set a pointer to one of those with GetDefaultAudioEndpoint(). Now I just need to be able to get some basic information out of it, like some speaker info or the ID of the speaker or anything like that. What's a good way to do this that a total beginner would be able to pick up on? Thanks!
推荐答案
设备连接有各种属性,你可以从设备属性存储读取它们。 MSDN这里给你一个code片断:
Devices have various properties attached, and you can read them from a device property store. MSDN gives you a code snippet here:
您还可以使用pre-内置工具来快速检查设备,看看你可以从 IMMDevice
指针获得什么:
You can also use pre-built utilities to quickly check your devices and see what you can obtain from a IMMDevice
pointer:
- 如何枚举音频终端(IMMDevice)特性在系统上
- 枚举音频MMDevice的
- How to enumerate audio endpoint (IMMDevice) properties on your system
- Enumerate Audio ‘MMDevice’s
后者presents你这样的属性:
The latter presents you the properties like this:
你可以在这里<一查源$ C $ C href=\"http://www.alax.info/trac/public/browser/trunk/Utilities/EnumerateAudioDevices/MainDialog.h#L72\" rel=\"nofollow\">http://www.alax.info/trac/public/browser/trunk/Utilities/EnumerateAudioDevices/MainDialog.h#L72它从尽可能多的开始具有符合72手 IMMDevice
指针。
And you can check source code here http://www.alax.info/trac/public/browser/trunk/Utilities/EnumerateAudioDevices/MainDialog.h#L72 that it starts from as much as having a IMMDevice
pointer on hands in line 72.
这篇关于我如何获得信息从IMMDevice的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!