Is it possible to relate the same audio device in different APIs?
I'm using the winmm api to deal with audio. I'm using waveInGetDeviceCaps
and waveInMessage
to uniquely identify an "audio line". Everything works fine, except that in Vista, the name of the device is capped in 32 chars by the WaveInCaps
struct.
To work around that, I'm envisioning using the core api开发者_如何学编程 when OS version is >= Vista. I'm using the IMMDeviceEnumerator.GetDevice
and IMMDeviceEnumerator.EnumAudioEndpoints
to gather audio line information, but I'm not sure how to tell that one device under core api relates to one entry under the waveXx api.
I guess I could compare the device path of both, but that would go against MS's recommendation of treating the device path string as "opaque".
What would you say?
This scenario is described in http://msdn.microsoft.com/en-us/library/dd370819(VS.85).aspx
#include <mmddk.h>
WCHAR szBuffer[256]
uiDeviceID = 0;
messageId = DRV_QUERYFUNCTIONINSTANCEID;
waveInMessage((HWAVEIN)IntToPtr(uiDeviceID), messageId, szBuffer, 256);
Then I get the guid as same as IMMDevice apis. Nice!
精彩评论