# Getting the length of an MP3 file

**URL:** <https://forum.kirupa.com/t/getting-the-length-of-an-mp3-file/202392>\
**Category:** flash\
**Created:** [September 30, 2006, 4:27pm UTC](https://forum.kirupa.com/t/getting-the-length-of-an-mp3-file/202392 "2006-09-30T16:27:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Almonimus](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Almonimus](https://forum.kirupa.com/u/Almonimus)\
**Post date:** [September 30, 2006, 4:27pm UTC](https://forum.kirupa.com/t/getting-the-length-of-an-mp3-file/202392/1 "2006-09-30T16:27:10Z")

</div>

I need to get the length of an MP3 file.  
I tried using the following code: **myFile.id3.TLEN;** yet it didn’t work.  
I copied (and changed a bit) the code from the help files and got this thingy:  
\*\*  
myFile.onID3 = function(){  
for( var prop in myFile.id3 ){  
trace( prop + " : "+ myFile.id3[prop] );  
}  
}  
myFile.loadSound(run\_url, false);\*\*

The code shows me all the parameters I can get. Seems like my MP3 file used id3v1 which may not support time length, so using Winamp 5.3 (last update), I passed the information to id3v2.

so I got some more parameters. Here’s the output:  
\*\*  
COMM :  
TIT2 : MySong  
TPE1 : Almonimus  
TYER : 2006  
TCON : Other  
TPE2 : Almonimus  
genre : Other  
track : 0  
comment :  
year : 2006  
album :  
artist : Almonimus  
songname : MySong\*\*

Seems like I still don’t have the required parameters in the id3tag. I am aware that Winamp doesn’t support id3v2.4 very well, so I downloaded a demo of Tag&Rename 3.2, and as you can guess, even after opening the file and resaving it, I can’t get this parameter.

Can anyone help me please?
