How to detect if a sound card is installed

 

This API class will detect if the computer has a sound card.

Remember if you use the declare statement in the form you must put, "Private" in front of declare.


=======================Add to Module ==================================

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"
Else
MsgBox "Your system can not play sound Files.", _
vbInformation, "Sound Card Test"
End If

========================= Add to Form =======================
Private Sub Form_Load()
waveOutGetNumDevs
End Sub