Streaming Audio Freeze

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

Thanks for any advice.

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:

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.

thanks guys :slight_smile:

Did my code work? :-\

hey slayerment =)

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

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

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

or you can increase the prebuffer time:

_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 :wink: =)