|
-
Jan 3rd, 2004, 03:31 AM
#1
Thread Starter
Member
Getting sound devices
I need to get a list of sound devices available so the user can select which one to use.. How do I find these?
-
Jan 3rd, 2004, 06:35 AM
#2
Hyperactive Member
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.
Last edited by jovton; Jan 3rd, 2004 at 03:28 PM.
jovton
-
Jan 3rd, 2004, 03:22 PM
#3
Thread Starter
Member
It works for the modem, yes, but not for the sounddevice..
-
Jan 3rd, 2004, 03:43 PM
#4
Hyperactive Member
Originally posted by paulheu
It works for the modem, yes, but not for the sounddevice..
Did you replace "Win32_POTSModem" with "Win32_SoundDevice"?
-
Jan 3rd, 2004, 07:07 PM
#5
Thread Starter
Member
yes.. I get an error if I do.. For those who wonder here's the code in question:
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
If I change the For .. next code to debug.writeline(mo) I get thsi back:
\\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..
Last edited by paulheu; Jan 3rd, 2004 at 07:18 PM.
-
Jan 3rd, 2004, 07:14 PM
#6
Frenzied Member
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
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Jan 3rd, 2004, 07:21 PM
#7
Thread Starter
Member
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.. ;^)
Last edited by paulheu; Jan 3rd, 2004 at 07:36 PM.
-
Jan 3rd, 2004, 10:32 PM
#8
Sleep mode
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 .
-
Jan 8th, 2004, 10:36 AM
#9
Thread Starter
Member
Update? yes an update :^)
I found this which is quite interesting.. I converted the code to .NET but now it does not find any soundcards.. Anyone willing to have a peek can get the .NET code I have now here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|