主题:谁知道mp3play.ocx的下列属性和方法的具体使用(跟+30分)
ashihama2008
[专家分:100] 发布于 2006-10-29 09:53:00
各位高人:
Mp3Play1.SetVolumeP
Mp3Play1.GetVolumeLeft
Mp3Play1.GetVolumeLeftP
Mp3Play1.PlayFromToS
Mp3Play1.PlayFromTo
Mp3Play1.SetSpeed
——————希望能给事例代码看看!
回复列表 (共4个回复)
沙发
VB浪子 [专家分:7690] 发布于 2006-10-30 09:30:00
dialog-Medien MP3Play ActiveX Control控件
完整的MP3播放代码(可以读取Mp3信息)
Option Explicit
Dim lv As Long, rv As Long
Private Sub Command1_Click()
Mp3Play1.Stop
Command1.Enabled = False
Command3.Enabled = False
End Sub
Private Sub Command2_Click()
Mp3Play1.Play
Command1.Enabled = True
Command3.Enabled = True
End Sub
Private Sub Command3_Click()
Mp3Play1.Pause
Command1.Enabled = False
Command3.Enabled = False
End Sub
Private Sub Command4_Click()
Mp3Play1.Close
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
End Sub
Private Sub Command5_Click()
End
End Sub
Private Sub Command6_Click()
'单击“打开”按钮
Dim totaltimes As Long
Dim mp3file As String, it As Integer
Dim i As Integer
Mp3Play1.Close
CommonDialog1.DialogTitle = "打开文件"
CommonDialog1.Filter = "MP3文件(*.MP3)|*.mp3"
CommonDialog1.ShowOpen
it = Len(CommonDialog1.FileName)
'获取MP3文件名称
For i = 1 To it
If Mid(CommonDialog1.FileName, it - i + 1, 1) = "\" Then
mp3file = Mid(CommonDialog1.FileName, it - i + 2, i - 5)
Exit For
End If
DoEvents
Next i
'打开Mp3Play
Err = Mp3Play1.Open(CommonDialog1.FileName, "")
'计算总时间长度
totaltimes = Mp3Play1.TotalTime
Label6.Caption = Str$(totaltimes \ 60000) & "分 " & Str$((totaltimes Mod 60000) / 1000) & "秒"
Label5.Caption = mp3file
Label7.Caption = Str$(Mp3Play1.BitRate / 1000) & "kbps"
Label8.Caption = Str$(Mp3Play1.SampleFrequency / 1000) & "khz"
'设置音量
lv = Mp3Play1.GetVolumeLeft
rv = Mp3Play1.GetVolumeRight
Command2.Enabled = True
Command4.Enabled = True
End Sub
Private Sub Form_Load()
Dim erra
erra = Mp3Play1.Authorize("ufo2000", "1208686909 ")
CommonDialog1.DialogTitle = "打开文件"
CommonDialog1.Filter = "MP3文件(*.MP3)|*.mp3"
Label2.Caption = "歌曲名称"
Label3.Caption = "时间"
Label5.Caption = ""
Label6.Caption = ""
Label7.Caption = "kbps"
Label8.Caption = "khz"
Slider1.Value = 20
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command1.Enabled = False
End Sub
Private Sub Slider1_Change()
Dim i
i = Mp3Play1.SetVolume(lv * Slider1.Value / 50, rv * Slider1.Value / 50)
End Sub
板凳
VB浪子 [专家分:7690] 发布于 2006-10-30 09:31:00
我也是网上找的 其实很多问题你不懂可以试着搜索一下 可以给你很多参考的~~
3 楼
ashihama2008 [专家分:100] 发布于 2006-10-30 20:18:00
多谢了!!!!!!!!!!!!!!!
4 楼
dvbbs1d [专家分:0] 发布于 2008-01-22 16:30:00
在我呢有
<a href=http://rgwan.vicp.net/Local/bbs/bbs/Dvbbs8.1.0_AC/UploadFile/2008-1\
/20081221354577035.rar>点击下载</a>
我来回复