ptigers9
ptigers9

Reputation: 109

Determine the length (in milliseconds) of an mp3 file in VB.net

Is there a way to get the time length of an mp3 in VB.net? I have TagLib, but it doesn't seem to have any functionality for it.

Upvotes: 0

Views: 3212

Answers (2)

betrice mpalanzi
betrice mpalanzi

Reputation: 1117

add this to timer of track bar and dont forgot to add label in

 Label4.Text = AxWindowsMediaPlayer1.Ctlcontrols.currentItem.durationString

player

Upvotes: 0

John Koerner
John Koerner

Reputation: 38079

I think you are looking for the TagLib.File.Properties.Duration, which returns a TimeSpan object. From there you can use TotalSeconds to get the length of the mp3 in seconds.

Upvotes: 2

Related Questions