Search code examples
c#audiowindows-vistawinmmcore-api

Confused about how Windows get audio line names


I'm getting very confused about how audio devices/lines/endpoints are named in windows (vista).

  • First I go to the control panel applet "Sound". Among others, I find one input line that resides physically on a USB Audio Device. The name of the "recording device" in the applet is:
    Microphone
    3- USB Audio Device Working

  • From the waveInGetDeviceCaps I get
    Microphone (3- USB Audio Device please note the lack of closing parenthesis

  • From the IMMDevice.IPropertyStore, I see two properties that I can extract name. One of them says
    Microphone
    and the other says USB Audio Device

Where does that "3- " comes from?


Solution

  • The "3-" depends on the USB port you connect the device to. If you move the device to another USB port it will get another number. This is to uniquely identify the same devices connected to different ports. The CoreAudio API uses a true ID (much like a GUID) to identify each device, so it doesn't need to encode the differences in the device name.

    Mind you, this is my take on using USB sound devices and the MME and CoreAudio APIs. The true story can probably be found in the DDK, or from the folks a Microsoft.