Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Precaching Sound

VonGklugelstein Alter
Bedah Profeshinal Tekstur
Join date: 22 Dec 2007
Posts: 808
10-01-2008 12:11
What would be a good way to precache sounds ie let the sound files silently load on visitor's viewers before they reach the point where the sound is called for?


good example.. Doors.. unless you already have the sound loaded.. you go.. you click or whatever your fancy script does, .. the door opens.. no sound.. then 10 seconds later.. delayyyyyyyed and out of synch sound..

:)
_____________________
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
10-01-2008 12:51
Check out the LSL Command "llPreloadSound( )". It does this. But the problem is you need to trigger it as part of an event that interacts with the user, and you need to add a "sleep" after it that is as long as the sound itself. So you could do something like this:

llPreloadSound( chimeA ); // First 10 sec of top-of-hour chimes
llSleep(10);

and then do whatever was supposed to play that sound.

I don't think it will work to have it preload when the item is rezzed, as the preload needs to interact with the person who should hear it? Not sure. I know that when I used this in my clock script to elimibate the delay, I ended up having it preload the sounds one minute before they would be used. Then when called, they played smoothly.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
VonGklugelstein Alter
Bedah Profeshinal Tekstur
Join date: 22 Dec 2007
Posts: 808
10-01-2008 18:01
I am thinking about playing them silently near the tp point so they are loaded. Sounds are not dependent on specific user interaction so if someone in the area triggers a sound, you hear it too.

Might need to find a wav player that will play a series of wavs in a loop
_____________________