没有合适的资源?快使用搜索试试~ 我知道了~
精彩编程与编程技巧-如何用API播放CD...
需积分: 4 3 下载量 38 浏览量
2009-10-10
23:03:43
上传
评论
收藏 1KB TXT 举报
温馨提示
试读
2页
精彩编程与编程技巧-如何用API播放CD ...
资源推荐
资源详情
资源评论
如何用API播放CD
'Author: Gordon F. MacLeod
' How to play a CD Audio disc via API
' Declare the following API
Declare Function mciSendString& Lib "MMSYSTEM" (ByVal lpstrCommand$,
ByVal lpstrReturnStr As Any, ByVal wReturnLen%, ByVal hCallBack%)
'Add the code below to appropriate routines
Sub cmdPlay_Click ()
Dim lRet As Long
Dim nCurrentTrack As Integer
'Open the device
lRet = mciSendString("open cdaudio alias cd wait", 0&, 0, 0)
'Set the time format to Tracks (default is milliseconds)
lRet = mciSendString("set cd time format tmsf", 0&, 0, 0)
'Then to play from the beginning
lRet = mciSendString("play cd", 0&, 0, 0)
'Or to play from a specific track, say track 4
nCurrentTrack = 4
lRet = mciSendString("play cd from" & Str(nCurrentTrack), 0&, 0, 0)
End Sub
'Author: Gordon F. MacLeod
' How to play a CD Audio disc via API
' Declare the following API
Declare Function mciSendString& Lib "MMSYSTEM" (ByVal lpstrCommand$,
ByVal lpstrReturnStr As Any, ByVal wReturnLen%, ByVal hCallBack%)
'Add the code below to appropriate routines
Sub cmdPlay_Click ()
Dim lRet As Long
Dim nCurrentTrack As Integer
'Open the device
lRet = mciSendString("open cdaudio alias cd wait", 0&, 0, 0)
'Set the time format to Tracks (default is milliseconds)
lRet = mciSendString("set cd time format tmsf", 0&, 0, 0)
'Then to play from the beginning
lRet = mciSendString("play cd", 0&, 0, 0)
'Or to play from a specific track, say track 4
nCurrentTrack = 4
lRet = mciSendString("play cd from" & Str(nCurrentTrack), 0&, 0, 0)
End Sub
资源评论
求伯乐
- 粉丝: 22
- 资源: 3095
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功