I'm writing a CD Audio player program using MCI, but I can't show the progress of the audio file on a trackbar.
Does anyone know how?
Note that I must use mciSendString
to get the track length.
I'm writing a CD Audio player program using MCI, but I can't show the progress of the audio file on a trackbar.
Does anyone know how?
Note that I must use mciSendString
to get the track length.
In VB I did this inside a Timer Tick Sub...easy peasy really...
rem audio is the mcisendstring thingy rem TotalLength is total seconds of current track
Dim PlayPosition As Long = 0
PlayPosition = audio.SecondsPlayed
If PlayPosition > 0 And PlayPosition < TotalLength Then
TrackBar1.Value = (PlayPosition / TotalLength) * TotalLength
End If
From Simple MCI Player - CodeProject, slightly altered: