# Streaming mp3's more than once...what's taking so long?

**URL:** <https://forum.kirupa.com/t/streaming-mp3s-more-than-once-whats-taking-so-long/219397>\
**Category:** flash\
**Created:** [March 16, 2007, 6:58am UTC](https://forum.kirupa.com/t/streaming-mp3s-more-than-once-whats-taking-so-long/219397 "2007-03-16T06:58:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickcherryjiggz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nickcherryjiggz/32/2107_2.png) [@nickcherryjiggz](https://forum.kirupa.com/u/nickcherryjiggz)\
**Post date:** [March 16, 2007, 6:58am UTC](https://forum.kirupa.com/t/streaming-mp3s-more-than-once-whats-taking-so-long/219397/1 "2007-03-16T06:58:17Z")

</div>

I have my mp3 player set to stream audio. Because of this, I ran into the problem of having \< 1 second of music play, then pause for a while, then actually begin to play fluidly. To prevent this annoying habit, I just stopped the mp3 immediately and made sure that a specified number of bytes were loaded before the song began to play:

```auto

s.stop();
_root.mc_player.onEnterFrame = function(){
    if (_root.s.getBytesLoaded() > _root.minBytesToStart){
        //_root.minBytesToStart = about 750000
        _root.s.start();
        _root.mc_player.onEnterFrame = null;
    }
}

```

This seemed to solve the problem. A little bit later, though, I decided to make a circular loading animation for the time taken to stream the first x bytes of the mp3. This was easy enough. I just made some slight adjustments to the code and all seemed well.

```auto

_root.mc_player.mc_loading.rewind = false;
_root.mc_player.mc_loading.play();
s.stop();
_root.mc_player.onEnterFrame = function(){
    if (_root.s.getBytesLoaded() > _root.minBytesToStart){
        //_root.minBytesToStart = about 750000
        _root.mc_player.mc_loading.rewind = true;
        _root.mc_player.mc_loading.prevFrame();
        _root.s.start();
        _root.mc_player.onEnterFrame = null;
    }
}

```

The first time through (meaning the first time I select each mp3), it works like a charm. However, when I click any of the songs a second time, the loading animation only lasts a second (meaning that \_root.s.getBytesLoaded() \> 750000), but the song doesn’t play for 5-10 seconds later (the time it originally took to stream). So basically, one thing (s.getBytesLoaded()) is telling me that most/all of the song is already loaded, while the other (the streaming, I guess) is thinking that it needs the whole file still. I really don’t have any idea what to do about this. Any ideas?
