Evo
Option Explicit
' Play the MP3 file.
Private Sub cmdPlay_Click()
If cmdPlay.Caption = "Play" Then
mmcAudio.FileName = txtFile.Text
mmcAudio.Command = "Open"
mmcAudio.Command = "Play"
cmdPlay.Caption = "Stop"
Else
mmcAudio.Command = "Stop"
mmcAudio.Command = "Close"
End If
End Sub
Private Sub Form_Load()
Dim app_path As String
app_path = App.Path
If Right$(app_path, 1) <> "\" Then app_path = app_path & "\"
'txtFile.Text = app_path & "Alice_Cooper-Gimmie.mp3"
txtFile.Text = app_path & "demo.mp3"
' Prepare the audio control.
mmcAudio.Notify = False
mmcAudio.Wait = True
mmcAudio.Shareable = False
mmcAudio.Command = "Close"
End Sub
Private Sub Form_Unload(Cancel As Integer)
' Close the multimedia device.
mmcAudio.Command = "Close"
End Sub
' Prepare the control to play again.
Private Sub mmcAudio_Done(NotifyCode As Integer)
mmcAudio.Command = "Close"
lblAudio.Caption = ""
cmdPlay.Caption = "Play"
End Sub
Private Sub mmcAudio_StatusUpdate()
lblAudio.Caption = mmcAudio.Position & "/" & mmcAudio.Length
End Sub
https://www.mycity.rs/must-login.png
|