# Track length sometimes incorrect

**URL:** https://community.mp3tag.de/t/track-length-sometimes-incorrect/1468
**Category:** Support
**Created:** [November 19, 2004, 3:36am UTC](https://community.mp3tag.de/t/track-length-sometimes-incorrect/1468 "2004-11-19T03:36:14Z")
**Posts on this page:** 1
**Showing post:** 14

<div class="post-metadata">

### Author: ![Sebastian\_Mares](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sebastian_mares/32/9285_2.png) [@Sebastian\_Mares](https://community.mp3tag.de/u/Sebastian_Mares)
#### Post date: [December 2, 2004, 8:10am UTC](https://community.mp3tag.de/t/track-length-sometimes-incorrect/1468/14 "2004-12-02T08:10:13Z")

</div>

> [@](#):
>
> I guess i'm trying to find out how a typical MP3 application determines the duration of a file. If I can determine that, I can probably go through my file and try and manually add up the times. MP3Library can tell me the numer of frames at each bit rate and also where the first "valid frame" begins. From that info can I manually calculate the duration of a file?
> 
> Thanks again, i'm just really curious about the structure of the file being a programmer also (mainframe not PC).
> 
> \<{POST\_SNAPBACK}\>

[erweiterte lokale cddb Abfrage](https://community.mp3tag.de/t/853/13)

The post is in German, but the pseudo code is English. 🙂

> [@](#):
>
> You know, I'm curious about this too. Micro$oft says that WMP gets the MP3 duration from the TLEN frame. When I manually set the TLEN tag in MP3Tag, it still reports the same incorrect time.
> 
> VBRFix has an option to preserve or clear the LAME header when it corrects my VBR MP3s. This implies the LAME has it's own headers which are independent of the others.
> 
> If there are multiple potential locations to get VBR duration from, this would explain why different applications report different playing times.
> 
> Jeremy
> 
> \<{POST\_SNAPBACK}\>

Windows Media Player 10 calculates the duration of the file based on the Xing header. VBR files encoded by Fraunhofer encoders will not work correctly with WMP (what the duration is concerned) because they use a VBRI header.  
Older versions of WMP used to read the duration from the TLEN frame of ID3v2.3 tags.

---

_[View the full topic](https://community.mp3tag.de/t/track-length-sometimes-incorrect/1468)._
