如何从SOUND.DRV中提取声音
-------------------------------------------------------------------
How to extract sounds from the SOUND.DRV library..
Here are 4 different sound effects that can called
via APIs to the "SOUND.DRV" library. You can modify
the values to create your own unique sounds.
Declare these APIs:
Declare Function OpenSound% Lib "sound.drv" ()
Declare Function VoiceQueueSize% Lib "sound.drv" (ByVal nVoice%, ByVal nByteS)
Declare Function SetVoiceSound% Lib "sound.drv" (ByVal nSource%, ByVal Freq&,
ByVal nDuration%)
Declare Function StartSound% Lib "sound.drv" ()
Declare Function CloseSound% Lib "sound.drv" ()
Declare Function WaitSoundState% Lib "sound.drv" (ByVal State%)
Add this routine, to be used with SirenSound1 routine
Sub Sound (ByVal Freq As Long, ByVal Duration As Integer)
Dim S As Integer
Shift frequency to high byte.
Freq = Freq * 2 ^ 16
S = SetVoiceSound(1, Freq, Duration)
S = StartSound()
While (WaitSoundState(1) <> 0): Wend
End Sub
Here are the 4 sound routines:
* Attention Sound #1 *
Sub AttenSound1 ()
Dim Succ, S As Integer
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()
End Sub
* Click Sound #1 *
Sub ClickSound1 ()
Dim Succ, S As Integer
Succ = OpenSound()
S = SetVoiceSound(1, 200 * 2 ^ 16, 2)
补充:软件开发 , Vb ,
上一个:如何用API播放CD
下一个:控制系统音量
- 更多VB疑问解答:
- vb把图片转换成 base64代码
- 批处理转移文 之errorlevel
- vb 6.0 调用vb.net dll混合程序集错误
- VB inet控件访问ftp 本机测试通过客户机inet控件使用失败。急!!
- 求助在Dir1控件当前目录下新建一个文件夹的代码
- CreateObject创建Word Excel对象失败,提示,无法加载DLL,怎么解决?
- 有两个磁盘阵列,如何使用能达到最好的效果
- cloudStack 如何实现 vSphere的DRS功能
- 和难缠客户的那些事儿
- 批处理转移文 之errorlevel
- vb 6.0 调用vb.net dll混合程序集错误
- VB inet控件访问ftp 本机测试通过客户机inet控件使用失败。急!!
- 求助在Dir1控件当前目录下新建一个文件夹的代码
- CreateObject创建Word Excel对象失败,提示,无法加载DLL,怎么解决?
- 有两个磁盘阵列,如何使用能达到最好的效果