我如何获得信息从IMMDevice的? [英] How do I get information out of IMMDevice?

查看:1253
本文介绍了我如何获得信息从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:

  • 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屋!

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