敬请各位高手解决win7系统的主板喇叭演奏音乐的问题。谢谢。
本单位的计算机无喇叭,如何使其主板喇叭演奏音乐?以下的2组代码不中:使主板喇叭演奏音乐
1
Option Explicit
Private Declare Function APIBeep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Form_Load()
APIBeep 2000, 500 'APIBeep 频率,时间
End Sub
Private Sub Command1_Click()
APIBeep 2000, 500
End Sub
2
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Command1_Click()
playsnd 440, 100
playsnd 494, 100
playsnd 554, 100
playsnd 622, 100
playsnd 698, 100
playsnd 784, 100
playsnd 880, 100
End Sub
Private Sub Form_Load()
playsnd 440, 100
playsnd 494, 100
playsnd 554, 100
playsnd 622, 100
playsnd 698, 100
playsnd 784, 100
playsnd 880, 100
End Sub
Function playsnd(ByVal x As Long, y As Long)
Beep x, y * 3
DoEvents
End Function