Hi, I just starting to use naudio. I currently creating a seekbar that can seek to any position of the song I want using C#. It is something like MP3 Player function. I have successfully load the song Totaltime into trackbar but fail to seek the song and the seekbar also fail to run as the song start playing. Below is my current code for the seekbar:
private void TrackPosition_ValueChanged(object sender, System.EventArgs e)
{
The TrackPosition is the seekbar I mentioned and I have loaded the song Totaltime into the seekbar but I fail to seek the song and make the seekbar run when the song is playing.
Do I left out something? Or anything wrong with the code? Sorry if I done anything wrong, I new to C#. Thanks for the help.
private void TrackPosition_ValueChanged(object sender, System.EventArgs e)
{
TrackPosition.Minimum = 0;
TrackPosition.Maximum = (int)mainOutputStream.TotalTime.TotalSeconds;
TrackPosition.Value = (int)mainOutputStream.CurrentTime.TotalSeconds;
mainOutputStream.Position = mainOutputStream.Position + TrackPosition.Value;
} The TrackPosition is the seekbar I mentioned and I have loaded the song Totaltime into the seekbar but I fail to seek the song and make the seekbar run when the song is playing.
Do I left out something? Or anything wrong with the code? Sorry if I done anything wrong, I new to C#. Thanks for the help.