# Sound Duration, problems

**URL:** <https://forum.kirupa.com/t/sound-duration-problems/214418>\
**Category:** flash\
**Created:** [January 28, 2007, 9:47pm UTC](https://forum.kirupa.com/t/sound-duration-problems/214418 "2007-01-28T21:47:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Natan](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@Natan](https://forum.kirupa.com/u/Natan)\
**Post date:** [January 28, 2007, 9:47pm UTC](https://forum.kirupa.com/t/sound-duration-problems/214418/1 "2007-01-28T21:47:02Z")

</div>

Hello!

I am crating a MP3 Player, and i have one problem to fix. When i use the my\_sound.duration (where my\_sound is var my\_sound:Sound = new Sound(); ), the duration only shows correcty when i use the onLoad method. Exemple:

var my\_sound:Sound = new Sound();  
my\_sound.loadSound (“my file.mp3”, true);  
my\_sound.onLoad = function() {  
duration\_txt.text = my\_sound.duration;  
}

But, i dont want wait the music complete loaded to show the duration, but when the music starts show the duration.

I cant use the id3.LEN on my file. The other soluction is put the duration information in a XML file and later show in the Flash, but i want somethig ease, more dinamic.

So, have soluction to my problem or i have to say the duration of the Music.

Thanks

Ps: Sorry for my English
