欢迎光临
我们一直在努力

如何从sound.drv中提取声音_visualbasic教程

建站超值云服务器,限时71元/月

——————————————————————-
Author:GordonF.MacLeod
HowtoextractsoundsfromtheSOUND.DRVlibrary..
Hereare4differentsoundeffectsthatcancalled
viaAPIstothe”SOUND.DRV”library.Youcanmodify
thevaluestocreateyourownuniquesounds.
DeclaretheseAPIs:

DeclareFunctionOpenSoundLib”sound.drv”()
DeclareFunctionVoiceQueueSizeLib”sound.drv”(ByValnVoice,ByValnByteS)
DeclareFunctionSetVoiceSoundLib”sound.drv”(ByValnSource,ByValFreq&,
ByValnDuration)
DeclareFunctionStartSoundLib”sound.drv”()
DeclareFunctionCloseSoundLib”sound.drv”()
DeclareFunctionWaitSoundStateLib”sound.drv”(ByValState)

Addthisroutine,tobeusedwithSirenSound1routine

SubSound(ByValFreqAsLong,ByValDurationAsInteger)
DimSAsInteger
Shiftfrequencytohighbyte.
Freq=Freq*2^16
S=SetVoiceSound(1,Freq,Duration)
S=StartSound()
While(WaitSoundState(1)<>0):Wend
EndSub

Herearethe4soundroutines:

*AttentionSound#1*
SubAttenSound1()
DimSucc,SAsInteger
Succ=OpenSound()
S=SetVoiceSound(1,1500*2^16,50)
S=SetVoiceSound(1,1000*2^16,50)
S=SetVoiceSound(1,1500*2^16,100)
S=SetVoiceSound(1,1000*2^16,100)
S=SetVoiceSound(1,800*2^16,40)

S=StartSound()
While(WaitSoundState(1)<>0):Wend
Succ=CloseSound()

EndSub

*ClickSound#1*
SubClickSound1()
DimSucc,SAsInteger
Succ=OpenSound()
S=SetVoiceSound(1,200*2^16,2)
S=StartSound()
While(WaitSoundState(1)<>0):Wend
Succ=CloseSound()

EndSub

*ErrorSound#1*
SubErrorSound1()
DimSucc,SAsInteger
Succ=OpenSound()
S=SetVoiceSound(1,200*2^16,150)
S=SetVoiceSound(1,100*2^16,100)
S=SetVoiceSound(1,80*2^16,90)
S=StartSound()
While(WaitSoundState(1)<>0):Wend
Succ=CloseSound()
EndSub

*SirenSound#1*
SubSirenSound1()
DimSuccAsInteger
DimJAsLong
Succ=OpenSound()
ForJ=440To1000Step5
CallSound(J,J/100)
NextJ
ForJ=1000To440Step-5
CallSound(J,J/100)
NextJ
Succ=CloseSound()

EndSub->

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 如何从sound.drv中提取声音_visualbasic教程
分享到: 更多 (0)