VB6.0中API的sndPlaySound函数?
PubilcDeclareFunctionsndPlaySoundLib"winmm.dll"Alias"sndPlaySoundA"(ByvallpssSoundNam...
Pubilc Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA"(Byval lpssSoundName as String,Byval aFlags as Long)as Long
编译错误:常数、固定长度字符串、数组、用户定义类型以及Declare语句不允许作为对象模块的Public成员。
还有这个函数如何使用?假如我D:\ABC.wav,我如何用它来发音呢?
我要代码和说明!我要代码和说明!我要代码和说明!
谢谢!谢谢! 展开
编译错误:常数、固定长度字符串、数组、用户定义类型以及Declare语句不允许作为对象模块的Public成员。
还有这个函数如何使用?假如我D:\ABC.wav,我如何用它来发音呢?
我要代码和说明!我要代码和说明!我要代码和说明!
谢谢!谢谢! 展开
2013-08-14
展开全部
错误是因为你把它写到了窗体里面.窗体里面不能这么写,要这样子
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA"(Byval lpssSoundName as String,Byval aFlags as Long)as Long
这个函数不能播放文件,要放文件要用
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Public Declare Function mciExecute Lib "winmm.dll" (ByVal lpstrCommand As String) As Long
这两个都能实现播放MP3,avi,wma,wmv,dat,mepg等等只要是你的wmp能播放的都可以播放,如果在调用real的控件,连RM,ra,rmvb都能播放了
mcisendstring "open c:\D:\ABC.wav alias WAV",0,0,0
mcisendstring "play mp3 wait",0,0,0
mcisendstring "stop mp3",0,0,0
mcisendstring "close mp3",0,0,0
windows早已内置了对mp3的支持
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA"(Byval lpssSoundName as String,Byval aFlags as Long)as Long
这个函数不能播放文件,要放文件要用
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Public Declare Function mciExecute Lib "winmm.dll" (ByVal lpstrCommand As String) As Long
这两个都能实现播放MP3,avi,wma,wmv,dat,mepg等等只要是你的wmp能播放的都可以播放,如果在调用real的控件,连RM,ra,rmvb都能播放了
mcisendstring "open c:\D:\ABC.wav alias WAV",0,0,0
mcisendstring "play mp3 wait",0,0,0
mcisendstring "stop mp3",0,0,0
mcisendstring "close mp3",0,0,0
windows早已内置了对mp3的支持
上海德康电子
2023-06-12 广告
2023-06-12 广告
上海德康电子科技有限公司成立于2003年。我们深耕电子领域近191载,积累了丰富的行业经验与资源,成为业内卓越的电子元器件代理商及方案供应商。...
点击进入详情页
本回答由上海德康电子提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询