Skip to content
lsl.devlsl.devLSL Dev

llPreloadSound

function

Replaces deprecated llSoundPreload.

Function syntax
llPreloadSound(
  1. string sound// Name of the sound in the prim's inventory, or a UUID.
);
Delay
1 s
Energy
10

Causes nearby viewers in range to preload the specified sound from the object's inventory to prevent playback delays.

Preloads sound on viewers within range

How to use
llPreloadSound("");
Example 1
6 collapsed lines
//Will preload a sound when rezzed, then play it when 'touched'.
string sound = "name or uuid";//sound in inventory or UUID of a sound.
default
{
on_rez(integer start_param)
{
llSetText("Preloading....",<1,0,0>,1);
llPreloadSound(sound);
llSetText("Touch To Play",<1,1,1>,1);
}
5 collapsed lines
touch_start(integer num_detected)
{
llPlaySound(sound, 1.0);
}
}

The wiki article also includes shared templates whose conditional content is not reproduced here: Template:Issues/BUG-7854.

Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.