# Duration problem with loadsound

**URL:** <https://forum.kirupa.com/t/duration-problem-with-loadsound/227205>\
**Category:** Uncategorized\
**Created:** [May 28, 2007, 1:47pm UTC](https://forum.kirupa.com/t/duration-problem-with-loadsound/227205 "2007-05-28T13:47:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![drphil](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@drphil](https://forum.kirupa.com/u/drphil)\
**Post date:** [May 28, 2007, 1:47pm UTC](https://forum.kirupa.com/t/duration-problem-with-loadsound/227205/1 "2007-05-28T13:47:07Z")

</div>

hi.

I`ve got a problem with getting out the duration from a mp3 song.Everything works fine until I simulate download. Then the duration starts to count from up 0 to the total songlength, it looks like it shows the position of the song but a little bit faster.

this.onEnterFrame = function() {

mySoundLenght = \_root.mySound.duration / 1000;  
mySoundPosition = \_root.mySound.position / 1000;

```
var minutes = Math.floor(mySoundPosition/60);
var seconds = Math.floor(mySoundPosition%60);

var secondLenght = Math.floor(mySoundLenght%60);
var minuteLength = Math.floor(mySoundLenght/60);

if (seconds&lt;10) {
    seconds = "0"+seconds;
}

if (minutes&lt;10) {
    minutes= "0"+minutes;
}

if (secondLenght&lt;10) {
secondLenght = "0"+secondLenght;
}

if (minuteLength&lt;10) {
    minuteLength= "0"+minuteLength;
}
positionTxt = minutes+" : "+seconds+" /";
    dutationTxt = minuteLength+" : "+secondLenght;

```

}
