Detect If Sound Card Can Play Sound Files

'Add a module to your project (In the menu choose Project -> Add Module, Then click Open)
'Insert this code to the module :

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

'Insert this code to your form:

Private Sub Form_Load()
Dim I As Integer
I = waveOutGetNumDevs()
If  I > 0 Then
MsgBox "Your system can play sound files."
Else
MsgBox "Your system can not play sound files."
End If
End Sub

Go Back