Me.Text = FilePath
AxWindowsMediaPlayer1.URL = FilePath
'设置播放模式 AxWindowsMediaPlayer1 .
Try
AxWindowsMediaPlayer1.Ctlcontrols.play()
Catch ex As Exception
MsgBox("对不起,不能播放此语音文件", MsgBoxStyle.OkOnly, "PC复读机")
Exit Sub
End Try
Dim StartPoint As Single = 0.0
Dim EndPoint As Single = 0.00001
Dim s1, m1 As Integer
Dim d1 As Single
m1 = d1 \ 60 : s1 = d1 Mod 60
LbStart.Text = Format(m1, "00") & ";" & Format(s1, "00.0")
Dim s2, m2 As Integer
m2 = EndPoint \ 60 : s2 = EndPoint Mod 60
LbEnd.Text = Format(m2, "00") & ":" & Format(s2, "00.0")
TkProgress.Minimum = 0
TkProgress.Maximum = AxWindowsMediaPlayer1.currentMedia.duration
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
其余菜单代码只需执行相应按钮对应的PerformClick事件。
(11)窗体的初始化代码
Private Sub Form1_Load1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
LbStart.Text = "开始点"
LbEnd.Text = "结束点"
LbStop.Enabled = "false"
LbPause.Enabled = "false"
End Sub
|