I need to get a list of sound devices available so the user can select which one to use.. How do I find these?
Printable View
I need to get a list of sound devices available so the user can select which one to use.. How do I find these?
Again, many thanks to persons like "Ken" and "Mike Hildner", they gave me a method that works almost prefectly. But I think it only works for Win 2K and up. It uses WMI.
Take a look at this thread:
http://www.vbforums.com/showthread.p...postid=1593456
This is for modems, but the same principle can be applied to sound devices. Just use "Win32_SoundDevice" instead of "Win32_POTSModem"
For some reason I feel like I can't stress my gratitude enough. :D
It works for the modem, yes, but not for the sounddevice..
Did you replace "Win32_POTSModem" with "Win32_SoundDevice"?Quote:
Originally posted by paulheu
It works for the modem, yes, but not for the sounddevice..
yes.. I get an error if I do.. For those who wonder here's the code in question:
If I change the For .. next code to debug.writeline(mo) I get thsi back:VB Code:
Dim moReturn As Management.ManagementObjectCollection Dim moSearch As Management.ManagementObjectSearcher Dim mo As Management.ManagementObject moSearch = New Management.ManagementObjectSearcher_ ("Select * from Win32_SoundDevice") moReturn = moSearch.Get For Each mo In moReturn Debug.WriteLine(mo("Name") & " is attached to " & mo_ ("AttachedTo")) Next
\\P4-2G0\root\cimv2:Win32_SoundDevice.DeviceID="PCI\\VEN_1102&DEV_0004&SUBSYS_10021102&REV_04\\4&1351887D &0&50F0"
which in itself works, but still does not help me any further but give me the location in the registry where the AudioDevice is..
That's because SoundDevice has no property called AttachedTo, remove that and it will work. Look here for the properties of sound device.
http://msdn.microsoft.com/library/en...asp?frame=true
While I got this working it does not help me. I'll try to explain:
I have a Creative Audigy using kX proect drivers. This driver gives me a total of 5 devices I can use:
kX Wave SB0240 10k2 [ff40] 0/1
kX Wave SB0240 10k2 [ff40] 4/5
kX Wave SB0240 10k2 [ff40] 6/7
kX Wave SB0240 10k2 [ff40] 8/9
kX Wave SB0240 10k2 [ff40] HQ
What I want to do is find these names and put them in a combobox so the user can select which device to use..
In this case the name exists in the registry as 'FriendlyName' under each separate instance of te device.. but I cannot find any reference to the name of the device entry while I assume there must be one somewhere.. So I am looking for the way to get to this name and also selecting the desired device for output..
Confused? I know I am.. ;^)
I think these are not real devices rather they appear to be drivers for one device . So ,that method could be only for hardwares , not sure though .Did you try anything with DX . That's world of Audio & Video .;)