标题:在VB中播放声音文件
取消只看楼主
随意魔
Rank: 1
等 级:新手上路
帖 子:184
专家分:0
注 册:2004-5-13
 问题点数:0 回复次数:0 
在VB中播放声音文件
Sub PlayWav(SoundName As String)
Dim tmpSoundName As String
Dim wFlags%, X%
, 声明语句部分 (请置于模块中)
,**********************************
,#If Win32 Then
,Public Declare Function sndPlaySound& Lib "winmm.dll" Alias
"sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) ,#Else
,Public Declare Function sndPlaySound% Lib "mmsystem.dll" (ByVal
lpszSoundName As String, ByVal uFlags As Integer)
,#End If
,WIN32
, **********************************
, WAV Sound values
,Global Const SND_SYNC = &H0
,Global Const SND_ASYNC = &H1
,Global Const SND_NODEFAULT = &H2
,Global Const SND_LOOP = &H8
,Global Const SND_NOSTOP = &H10
, **********************************
, *** pathWavFiles 是声音文件存放的路径
tmpSoundName = pathWavFiles & SoundName
wFlags% = SND_ASYNC Or SND_NODEFAULT
X% = sndPlaySound(tmpSoundName, wFlags%)
End Sub
搜索更多相关主题的帖子: 文件 声音 播放 
2004-05-19 10:34



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-1636-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.362429 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved