VB怎样让声卡发声
展开全部
使用API函数,可以播放音乐!
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Declare Function sndPlaySoundFromMemory Lib "winmm.dll" Alias "sndPlaySoundA" (lpszSoundName As Any, ByVal uFlags As Long) As Long
Private Sub Command1_Click()
Dim t As String, bb() As Byte
' t = ThisWorkbook.Path & "\SoundTest.wav"
t = "SystemStart"
t = "SystemExit"
' Call PlaySound(t, 0&, &H1)
' Call sndPlaySound(t, &H1)
bb = LoadResData(101, "wav")
Call sndPlaySoundFromMemory(bb(0), &H4 Or &H1)
'异步播放可以立即执行下面的代码
MsgBox "我被执行啦"
Debug.Print t
End Sub
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Declare Function sndPlaySoundFromMemory Lib "winmm.dll" Alias "sndPlaySoundA" (lpszSoundName As Any, ByVal uFlags As Long) As Long
Private Sub Command1_Click()
Dim t As String, bb() As Byte
' t = ThisWorkbook.Path & "\SoundTest.wav"
t = "SystemStart"
t = "SystemExit"
' Call PlaySound(t, 0&, &H1)
' Call sndPlaySound(t, &H1)
bb = LoadResData(101, "wav")
Call sndPlaySoundFromMemory(bb(0), &H4 Or &H1)
'异步播放可以立即执行下面的代码
MsgBox "我被执行啦"
Debug.Print t
End Sub
其高
2024-11-29 广告
2024-11-29 广告
声学相机即麦克风阵列,也叫声相仪。【上海其高电子科技有限公司】长期专注于声音振动信号处理应用,其研发的声学相机包括便携式、工业型、高性能及定制化系列产品,可满足不同应用场景需求。目前其高科技声学相机已在电力行业、汽车行业、消费电子、高校研究...
点击进入详情页
本回答由其高提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询