[wdmaudiodev] Re: Microphone Type

  • From: Mitchell Rundle <mitchr@xxxxxxxxxxxxx>
  • To: "'wdmaudiodev@xxxxxxxxxxxxx'" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Mon, 18 Sep 2006 11:04:49 -0700

You are looking for the "form factor".  The following code should do it

    EndpointFormFactor      formFactor;
    CComPtr<IPropertyStore> spProperties;

    hr = pEndpoint->OpenPropertyStore(STGM_READ, &spProperties);
    if (SUCCEEDED(hr))
    {
        hr = spProperties->GetValue(PKEY_AudioEndpoint_FormFactor, &var);
        if (SUCCEEDED(hr) && (var.vt == VT_UI4))
        {
            formFactor = (EndpointFormFactor)var.ulVal;

            ...

EndpointFormFactor is defined in mmdeviceapi.h.

Regards,
Mitch Rundle
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

________________________________
From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Kelly Johnson
Sent: Monday, September 18, 2006 10:13 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Microphone Type

When I get the default endpoint, I need to know its type, ie Microphone vs 
LineIn.  I'm currently querying all the properties, but I don't see anything 
that looks dependable.  I can't go off the name, since this has to run in many 
languages.

After querying all the properties for both the microphone and LineIn, the only 
differences I saw are the name, and one other property (idx 4) that I don't 
know what it is.

So the question is:  Given the default capture endpoint, how do I know if it's 
for a microphone or Line In?

Kelly

Other related posts: