What determines the order of sound devices in windows when using winmm.dll?

I am trying to use NAudio to create an application to output multiple sounds. We have 8 USB sound cards installed. NAudio allows me to use all 8, but I cannot define a template to determine which device index is that card.

The cards will be connected to other equipment, so it is important to make sure that you know which card you are using.

I am trying to use WMI to poll information, but I can not find any information that determines the order of sound devices.

Update: I forgot to include some information about this issue. Sound cards - all USB sound cards connected through a hub with 12 ports.

+5
source share
4 answers

The order of devices is not deterministic for all versions of Windows. For Vista and above, devices are usually ordered using a DSID GUID (more or less), so they are effectively random.

+3
source

I assume you are using WaveOut? You can call WaveOut.GetCapabilities (deviceNumber) to get a device name that can help you.

+2
source

, , .

WMI, DeviceID Win32_SoundDevice. , , HKLM\SYSTEM\CurrentControlSet\ENUM\'DeviceID' "". ClassGUID .

: {4d36e96c-e325-11ce-bfc1-08002be10318}\0015

* (15) * , , NAudio winmm.dll. , , Win32_PNPEntity, DeviceID.

, USB .

+2

Take a look at this MSDN article. It uses DirectSound to list audio devices:

http://msdn.microsoft.com/en-us/library/bb318674(VS.85).aspx

+1
source

All Articles