如何从SOUND.DRV中提取声音

赢在学习l

赢在学习l

2016-02-19 17:55

生活已是百般艰难,为何不努力一点。下面图老师就给大家分享如何从SOUND.DRV中提取声音,希望可以让热爱学习的朋友们体会到设计的小小的乐趣。
'-------------------------------------------------------------------
  'Author:GordonF.MacLeod
  'HowtoextractsoundsfromtheSOUND.DRVlibrary..
  'Hereare4differentsoundeffectsthatcancalled
  'viaAPI'stothe"SOUND.DRV"library.Youcanmodify
  'thevaluestocreateyourownuniquesounds.
  'DeclaretheseAPI's:
  
  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->

展开更多 50%)
分享

猜你喜欢

如何从SOUND.DRV中提取声音

编程语言 网络编程
如何从SOUND.DRV中提取声音

从文件中提取图标

编程语言 网络编程
从文件中提取图标

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

如何从Html页面中提取所有汉字

Web开发
如何从Html页面中提取所有汉字

声音与型态Sound攻略

电脑网络
声音与型态Sound攻略

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

Excel2018如何从数据源中提取条件数据

excel
Excel2018如何从数据源中提取条件数据

Photoshop从作品中提取色彩及应用的技巧

PS PS基础
Photoshop从作品中提取色彩及应用的技巧

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

win10怎么把edge设置为默认浏览器

win10怎么把edge设置为默认浏览器

用VB6的双通道技术获得影碟片断

用VB6的双通道技术获得影碟片断
下拉加载更多内容 ↓