->-chengdx
回答1:
Mmsound.drv是小喇叭的系统接口,很多API的书都有用法介绍
-219张晶
回答2:
使用VB中的beep语句,但这只能发出一种声音。如果想发出不同声音,可以
使用API函数。详情如下:(摘自VB-Helper)
UsetheBeepAPIfunction.
Thisexampledemonstratestwointerestingthings.First,itshowshowtomakeabeepofanyfrequencyanddurationratherthanusingthestandardtoneyougetwiththeBeepstatement.
Second,notethattheBeepAPIfunctionhasthesamenameasVisualBasicsBeepstatement.Todifferentiatethem,youcanassignanewnametotheBeepAPIfunctioninitsDeclarestatement.Itisknownas”Beep”inthelibrary(theAliasstatement)butitisknownasAPIBeeptotheprogram.
Youcanusethistechniquetodifferentiatebetweenfunctionswiththesamename,oryoucanuseittogiveAPIfunctionsanamethatiseasiertowrite(forexample,iftheAPInameisverylong).
Inthedeclarationssection:
OptionExplicit
PrivateDeclareFunctionAPIBeepLib”kernel32″Alias”Beep”(ByValdwFreqAsLong,ByValdwDurationAsLong)AsLong
Tomakeabeeplasting500millisecondswithfrequencyspecifiedinthe
TextBoxtxtFrequency(try1000forstarters):
PrivateSubCommand1_Click()
DimfrequencyAsLong
frequency=CLng(txtFrequency.Text)
APIBeepfrequency,500
EndSub
-Prisoner->
->
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:
IDC资讯中心 »
在vb5中如何使机箱内的小喇叭发出不同的声音?_visualbasic教程