# mp3 length before fully downloaded

**URL:** https://forum.kirupa.com/t/mp3-length-before-fully-downloaded/296259
**Category:** flash
**Created:** [September 11, 2009, 6:50pm UTC](https://forum.kirupa.com/t/mp3-length-before-fully-downloaded/296259 "2009-09-11T18:50:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![radd](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/radd/32/1767_2.png) [@radd](https://forum.kirupa.com/u/radd)
#### Post date: [September 11, 2009, 6:50pm UTC](https://forum.kirupa.com/t/mp3-length-before-fully-downloaded/296259/1 "2009-09-11T18:50:22Z")

</div>

Hi,

As far as I know, Flash doesn’t know the exact length of an MP3 loaded via URLLoader (or similar) before it’s actually fully downloaded. There are ways to approximate it but they are close to zero precision to me :

```php
lengthMili = (mySound.bytesTotal / (mySound.bytesLoaded / mySound.length)) / 1000;

```

Can you tell me how a player like [hypem.com](http://hypem.com) knows the lenght, then?  
HYPEM uses : [http://static.hypem.com/h4\_skin4.swf](http://static.hypem.com/h4_skin4.swf)
