# Streaming Audio Freeze

**URL:** <https://forum.kirupa.com/t/streaming-audio-freeze/16155>\
**Category:** flash\
**Created:** [March 21, 2003, 4:23pm UTC](https://forum.kirupa.com/t/streaming-audio-freeze/16155 "2003-03-21T16:23:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![slayerment](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@slayerment](https://forum.kirupa.com/u/slayerment)\
**Post date:** [March 21, 2003, 4:23pm UTC](https://forum.kirupa.com/t/streaming-audio-freeze/16155/1 "2003-03-21T16:23:50Z")

</div>

Has anybody had a problem where the browser freezes for a few seconds when you load the streaming audio, or is it just me?  
Im using this code:

bgmusic = new Sound();  
bgmusic.loadSound(“cynic.mp3”, true);  
bgmusic.start();

to stream the background music, but it seems to pause right when it starts. If you want to see what I’m talking about go to.

[www.new-valley.com/enhanced/index.htm](http://www.new-valley.com/enhanced/index.htm)

Thanks for any advice.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 21, 2003, 4:45pm UTC](https://forum.kirupa.com/t/streaming-audio-freeze/16155/2 "2003-03-21T16:45:34Z")

</div>

bgmusic = new Sound();  
bgmusic.loadSound(“cynic.mp3”, true);  
bgmusic.start();

the 2nd line should be:

bgmusic.loadSound(“cynic.mp3”, false);

this will prevent the sound from playing until all of it is downloaded, so it won’t freeze during playing.  
:rambo:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 21, 2003, 5:37pm UTC](https://forum.kirupa.com/t/streaming-audio-freeze/16155/3 "2003-03-21T17:37:08Z")

</div>

Hi slayerment,

I like your flat earth site.

You are doing your code right. I’m not sure if you are trying to get sound to stream over broadband or dialup, but I would try to mess around with the \_soundbuftime = 5; property. I think by default it is set at 5.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 22, 2003, 6:32am UTC](https://forum.kirupa.com/t/streaming-audio-freeze/16155/4 "2003-03-22T06:32:29Z")

</div>

thanks guys 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 22, 2003, 7:23am UTC](https://forum.kirupa.com/t/streaming-audio-freeze/16155/5 "2003-03-22T07:23:02Z")

</div>

Did my code work? :-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 22, 2003, 7:38am UTC](https://forum.kirupa.com/t/streaming-audio-freeze/16155/6 "2003-03-22T07:38:48Z")

</div>

hey **slayerment** =)

with your last post i’d assume that you solved the problem. still i’m gonna post a few lines of code 😉

to load the whole mp3 and then play it automatically … use the **onLoad** handler:

```auto
bgmusic = new Sound();
bgmusic.loadSound("cynic.mp3");
bgmusic.onLoad = function() {
	this.start();
}

```

or you can increase the prebuffer time:

```auto
_soundbuftime = *integer*;
bgmusic = new Sound();
bgmusic.loadSound("cynic.mp3", true);

```

_integer_ the number of seconds before the movie starts to stream

hope this helps in the future 😉 =)
