简体   繁体   中英

How do I get information out of IMMDevice?

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!

Devices have various properties attached, and you can read them from a device property store. MSDN gives you a code snippet here:

Audio Endpoint Devices > Device Properties

You can also use pre-built utilities to quickly check your devices and see what you can obtain from a IMMDevice pointer:

The latter presents you the properties like this:

在此输入图像描述

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM