I'm using TagLib# to get ID3 tag data from some MP3s, but what I can't seem to do is find the length of the MP3. How can I find the length of an MP3 in C#?
this is not really working for me... the lenght returned by the lib is incorrect of a few seconds
marcgg
2009-07-31 18:08:04
Parsing MP3s is something I'd rather have in a library, than copied and pasted from code written in 2001.
J. Pablo Fernández
2009-12-30 20:49:23
this method uses the file length to calculate the duration. this is an incorrect approach since for example adding an album art to the mp3 file increases the file length, but it does not effect the duration. this method fails at this point.
davsan
2010-03-21 17:30:14
broken link, please check...
cevik
2010-07-29 08:17:11
That was easy to get it to work, but it's returning about 70% of the real duration of all the files I tried it with.
J. Pablo Fernández
2009-12-30 21:33:17
I can't say I've tested it tbh so you could be right. I get the impression calculating duration from headers is an inexact science.
dwynne
2010-01-07 15:37:56
I've tested taglib-sharp and it was max. 1 seconds wrong. this library does not use the file length to get the duration, so i'll definitely go with this.
davsan
2010-03-21 19:41:55