เทคนิคการตรวจสอบ Sound Card

เครื่องคอมฯจ๋า เจ้าจะเปล่งเสียงออกมาได้มั้ย
เมื่อเราต้องการตรวจสอบว่าเครื่องมี Sound Card หรือไม่ นี่ก็เป็นโค้ดที่ใช้ตรวจสอบ Sound Card ครับ

Private Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long
Private Sub cmdCanPlay_Click()
Dim i As Long
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
End Sub

Post new comment

คำนวณผลบวกด้านบนแล้วกรอกผลลัพธ์ลงในช่อง เช่น 2 ลบ 1 ให้พิมพ์ 1