2 kaixinde102 kaixinde102 于 2014.09.12 11:48 提问

vb api beep 如何从蜂鸣器输入声音(win7/win8运行环境)代码如下:

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Command1_Click()
playsnd 440, 200
playsnd 20001, 75
playsnd 495, 200
playsnd 20001, 75
playsnd 550, 200
playsnd 20001, 75
playsnd 587, 200
playsnd 20001, 75
playsnd 660, 200
playsnd 20001, 75
playsnd 733, 200
playsnd 20001, 75
playsnd 825, 200
playsnd 20001, 75
playsnd 880, 200
playsnd 20001, 75
playsnd 880, 200
playsnd 20001, 75
playsnd 825, 200
playsnd 20001, 75
playsnd 733, 200
playsnd 20001, 75
playsnd 660, 200
playsnd 20001, 75
playsnd 587, 200
playsnd 20001, 75
playsnd 550, 200
playsnd 20001, 75
playsnd 495, 200
playsnd 20001, 75
playsnd 440, 200
End Sub
Function playsnd(ByVal x As Long, y As Long)
Beep x, y * 3
DoEvents
End Function
以上代码只能从扬声器中输入,我需要以上代码从蜂鸣器中输出;请各位大神帮忙谢谢!!

Csdn user default icon
上传中...
上传图片
插入图片