faire Posted May 21, 2008 Share Posted May 21, 2008 Is it possible to detect whether a user has a soundcard installed? My app has some background music, but it shows some nasty errors if there's no soundcard available. Of course I've made a "-nomusic" switch, but it would still be better if I could detect whether a soundcard is available. Perhaps there's a registry key somewhere that I can read..? Link to comment Share on other sites More sharing options...
evilertoaster Posted May 21, 2008 Share Posted May 21, 2008 $NumberOfSoundCards=DllCall("winmm.dll","uint","waveOutGetNumDevs") MsgBox(0,"Number of sound cards is:",$NumberOfSoundCards[0]) Link to comment Share on other sites More sharing options...
faire Posted May 21, 2008 Author Share Posted May 21, 2008 (edited) $NumberOfSoundCards=DllCall("winmm.dll","uint","waveOutGetNumDevs") MsgBox(0,"Number of sound cards is:",$NumberOfSoundCards[0])Sweeeet. I can confirm it works, because I have 2 soundcards and it in fact returns 2.If you don't mind me asking, how did you find out which DllCall to perform?Edit: aha, MSDN: http://msdn.microsoft.com/en-us/library/ms713748(VS.85).aspx. I can see how that fits together with the command. Edited May 21, 2008 by faire Link to comment Share on other sites More sharing options...
evilertoaster Posted May 21, 2008 Share Posted May 21, 2008 If you don't mind me asking, how did you find out which DllCall to perform?As with a LARGE number of questions on this forum, I simply ask google the same question, (often appending a 'VB' to get programing related results) and then convert the answer into autoit.search phrase: detect a sound card VBfirst result. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now