还有,如何用vb.net或api函数调节声音大小(我想在"警告"提示时,将音量调到最大,警告完毕后,再恢复正常音量!)??
...
还想问一下,做声响"警告"时,还有没有别的好办法???
谢谢大家!!!
5 个解决方案
#1
beep
#2
你狗狠啊.放那么大想吓死人
#3
呵呵~~..
用函数及vb.net语句怎么写呢?
用函数及vb.net语句怎么写呢?
#4
播放声音的API我有
调节大小没有!
调节大小没有!
#5
waveOutSetVolume
是设置音量的 wave 属性,与直接调节音量大小有区别,不过也是能用的
实例如下:
'Example submitted by Danjel Nyberg
'It needs a textbox (Text1) and two command buttons (Command1, Command2)
Private Declare Function waveOutSetVolume Lib "Winmm" (ByVal wDeviceID As Integer, ByVal dwVolume As Long) As Integer
Private Declare Function waveOutGetVolume Lib "Winmm" (ByVal wDeviceID As Integer, dwVolume As Long) As Integer
Private Sub Command1_Click()
Dim a, i As Long
Dim tmp As String
a = waveOutGetVolume(0, i)
tmp = "&h" & Right(Hex$(i), 4)
Text1 = CLng(tmp)
End Sub
Private Sub Command2_Click()
Dim a, i As Long
Dim tmp, vol As String
vol = Text1
tmp = Right((Hex$(vol + 65536)), 4)
vol = CLng("&H" & tmp & tmp)
a = waveOutSetVolume(0, vol)
End Sub
是设置音量的 wave 属性,与直接调节音量大小有区别,不过也是能用的
实例如下:
'Example submitted by Danjel Nyberg
'It needs a textbox (Text1) and two command buttons (Command1, Command2)
Private Declare Function waveOutSetVolume Lib "Winmm" (ByVal wDeviceID As Integer, ByVal dwVolume As Long) As Integer
Private Declare Function waveOutGetVolume Lib "Winmm" (ByVal wDeviceID As Integer, dwVolume As Long) As Integer
Private Sub Command1_Click()
Dim a, i As Long
Dim tmp As String
a = waveOutGetVolume(0, i)
tmp = "&h" & Right(Hex$(i), 4)
Text1 = CLng(tmp)
End Sub
Private Sub Command2_Click()
Dim a, i As Long
Dim tmp, vol As String
vol = Text1
tmp = Right((Hex$(vol + 65536)), 4)
vol = CLng("&H" & tmp & tmp)
a = waveOutSetVolume(0, vol)
End Sub
#1
beep
#2
你狗狠啊.放那么大想吓死人
#3
呵呵~~..
用函数及vb.net语句怎么写呢?
用函数及vb.net语句怎么写呢?
#4
播放声音的API我有
调节大小没有!
调节大小没有!
#5
waveOutSetVolume
是设置音量的 wave 属性,与直接调节音量大小有区别,不过也是能用的
实例如下:
'Example submitted by Danjel Nyberg
'It needs a textbox (Text1) and two command buttons (Command1, Command2)
Private Declare Function waveOutSetVolume Lib "Winmm" (ByVal wDeviceID As Integer, ByVal dwVolume As Long) As Integer
Private Declare Function waveOutGetVolume Lib "Winmm" (ByVal wDeviceID As Integer, dwVolume As Long) As Integer
Private Sub Command1_Click()
Dim a, i As Long
Dim tmp As String
a = waveOutGetVolume(0, i)
tmp = "&h" & Right(Hex$(i), 4)
Text1 = CLng(tmp)
End Sub
Private Sub Command2_Click()
Dim a, i As Long
Dim tmp, vol As String
vol = Text1
tmp = Right((Hex$(vol + 65536)), 4)
vol = CLng("&H" & tmp & tmp)
a = waveOutSetVolume(0, vol)
End Sub
是设置音量的 wave 属性,与直接调节音量大小有区别,不过也是能用的
实例如下:
'Example submitted by Danjel Nyberg
'It needs a textbox (Text1) and two command buttons (Command1, Command2)
Private Declare Function waveOutSetVolume Lib "Winmm" (ByVal wDeviceID As Integer, ByVal dwVolume As Long) As Integer
Private Declare Function waveOutGetVolume Lib "Winmm" (ByVal wDeviceID As Integer, dwVolume As Long) As Integer
Private Sub Command1_Click()
Dim a, i As Long
Dim tmp As String
a = waveOutGetVolume(0, i)
tmp = "&h" & Right(Hex$(i), 4)
Text1 = CLng(tmp)
End Sub
Private Sub Command2_Click()
Dim a, i As Long
Dim tmp, vol As String
vol = Text1
tmp = Right((Hex$(vol + 65536)), 4)
vol = CLng("&H" & tmp & tmp)
a = waveOutSetVolume(0, vol)
End Sub