当前位置:编程学习 > VB >>

VB获取声音实时强度如何做?

自动获取声卡即时的声音的强度值.如何实现,求一函数.最好是用winmm.dll库实现.
--------------------编程问答-------------------- waveOutGetVolume();
http://www.cnblogs.com/del/archive/2008/02/24/1079895.html --------------------编程问答-------------------- 这里有几个:
http://www.mndsoft.com/blog/article.asp?id=1036
http://www.mndsoft.com/blog/article.asp?id=912
http://www.mndsoft.com/blog/article.asp?id=703
--------------------编程问答-------------------- 希望有关达人能个一段代码,关于winmm.dll的导入声明我已经有一堆了,主要是如何实现不知道. --------------------编程问答-------------------- 帮你顶~~~~~~~~~ --------------------编程问答-------------------- 学习了 --------------------编程问答-------------------- '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
补充:VB ,  多媒体
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,