llPreloadSound(string sound)
Preloads the
sound clip defined by
sound. If
sound is in the
task's
inventory, then
sound can be the
name of the sound clip. If not,
sound must be the
key of the sound clip.
This function
delays the
script 1 second.
Note:There's still a bug that, when llPreloadSound is used in connection with llPlaySound, will cause the latter to loop the sound in some circumstances. -CorbenRadium 06/06/2010
Example:
default
{
state_entry()
{
// preload "mysound" for anyone that is currently in listening range of this object.
llPreloadSound("mysound");
}
touch_start(integer num_detected)
{
llPlaySound("mysound", 1.0); // play "mysound" when touched.
}
}
This article wasn't helpful for you? Maybe the
related article at the LSL Portal is able to bring enlightenment.
Functions |
Sound