Click here to Skip to main content
15,888,064 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I played a mp3 file using axWindowsMediaPlayer in c#.When tried to get the duration of the file in a label using the following code,it shows the duration in seconds.


label2.Text = axWindowsMediaPlayer1.currentMedia.duration.ToString();


Is there any way to show the duration in minutes?

Thank you.
Posted

Hi,

Please have a look at the following link:

Duration[^] - Just divide the seconds by 60 (60 sec in a min)

Kind regards,
 
Share this answer
 
For a more customized playing time display, you should have a look at the TimeSpan structure[^], especially its FromSeconds() and ToString() methods.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900