This project has moved. For the latest updates, please go here.

What's wrong with my code?

Sep 30, 2012 at 7:09 AM
Edited Sep 30, 2012 at 7:09 AM

 

I has tested the condition, but it always return true result.
This is the code:

playerDevice.Init(mp3Reader);

if (mp3Reader.CurrentTime < mp3Reader.TotalTime)
       {                
            playerDevice.Play();           
       }
else
       {            
            playerDevice.Stop();   
            playerDevice.Dispose();
            playerDevice = null;
            MessageBox.Show("Playback end.");
       } 
Sep 30, 2012 at 9:39 AM

I has fixed it using DispatcherTimer class to call the method every second.