-
I'm using the Windows Media Player to play audio files (mainly mp3s), and have it hidden (so I am unable to see the time remaining in one of the bars), and was wanting to have a label that showed how much time was remaining in the song. I've been using the MediaPlayer.SelectionEnd and MediaPlayer.CurrentPosition, along with a timer (interval at 1000), to try and display the time remaining, but i can't come close to getting it to work properly (with the label formatted like: "00:00"). All help is greatly apprecieated.
-
Try:
Code:
Private Sub Command1_Click()
With MediaPlayer1
.FileName = "C:\Windows\Media\The Microsoft Sound.wav"
.Play
While .PlayState = mpPlaying
Caption = .CurrentPosition
DoEvents
Wend
End With
End Sub
Alternatively use the Microsoft Multimedia Control:
Code:
Private Sub Command1_Click()
With MMControl1
.Visible = False
.UpdateInterval = 100
.TimeFormat = mciFormatMilliseconds
.FileName = "C:\Windows\Media\The Microsoft Sound.wav"
.Command = "Open"
.Command = "Play"
End With
End Sub
Private Sub MMControl1_StatusUpdate()
Caption = MMControl1.Position / 1000
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-