AllAPI Network - The KPD-Team

Allapi Network

 API List

API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
This Site
 Search Engine
 Contact Form

Donate to

How can I detect if the system has a sound card?

A lot of programs are now playing sounds for certain events.   However, there is no point in wasting time by playing a sound if the system does not support it.  This tip demonstrates how to detect if a sound card exists.

Add the following code to the declarations section of the project.

Declare Function waveOutGetNumDevs Lib "winmm.dll" _
Alias "waveOutGetNumDevs" () As Long            


Dim i As Integer
i = waveOutGetNumDevs()
If i > 0 Then
MsgBox "Your system can play sound files.", _
vbInformation, "Sound Card Test"
MsgBox "Your system can not play sound Files.", _
vbInformation, "Sound Card Test"
End If



Copyright © 1998-2007, The Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at