使机箱内的小喇叭发出不同的声音
使用VB中的beep语句只能发出一种声音。如果想发出不同声音,可以使用API函数。
OptionExplicit
PrivateDeclareFunctionAPIBeepLib"kernel32"Alias"Beep"(ByValdwFreqAsLong,ByValdwDurationAsLong)AsLong
PrivateSubCommand1_Click()
DimfrequencyAsLong
frequency=CLng(txtFrequency.Text)
APIBeepfrequency,500
EndSub->
OptionExplicit
PrivateDeclareFunctionAPIBeepLib"kernel32"Alias"Beep"(ByValdwFreqAsLong,ByValdwDurationAsLong)AsLong
PrivateSubCommand1_Click()
DimfrequencyAsLong
frequency=CLng(txtFrequency.Text)
APIBeepfrequency,500
EndSub->
- 上一篇:如何控制系统音量
- 下一篇:如何用API及MMSYSTEM.DLL播放AVI文件
精彩图集
精彩文章