$nav ===== Function: llPlaySound ===== llPlaySound(string sound, float volume) Play a $lart[sound] once in the current prim. ===== Parameters ===== === sound === A $lty[string] with the sound name, or a $lart[UUID]. If it is a sound name, it must exist in the inventory of the prim. === volume === The volume from 0.0 (minimum) to 1.0 (max) ===== Notes ===== * The playing sound will move with the prim (if the prim moves, so will the sound). * A prim can only have one sound at a time. If another sound starts playing, the currently playing sound or $lfn[llLoopSound|looped sound] will stop, unless $lfn[llSetSoundQueueing] is set to $ct[TRUE]. * Note that $lfn[llTriggerSound] and $lfn[llTriggerSoundLimited] start sounds that are not part of a prim, but are "dropped" where the prim is at the time of starting and become independent, and are therefore not subject to this limitation. * If the prim belongs to a $lart[HUD], the sound started by $fn[llPlaySound] will be heard only by the wearer. To play sounds from a $art[HUD] that can be heard by people around, use $lfn[llTriggerSound] or $lfn[llTriggerSoundLimited]. * If the sound is a $lart[UUID], it doesn't need to be present in the prim. * If the name of a sound present in the prim's inventory matches the $art[UUID] of a different sound, the sound that will play is the one in the item, not the $art[UUID]. * If the name is not a $art[UUID], and it is not present in the prim's inventory, or if an item with that name which is not a sound exists in the prim's inventory, an error will be privately said (20m range) to the owner in $lct[DEBUG_CHANNEL]. ===== Short examples ===== // Looks for a sound named "Applause" in the prim's inventor y, // playing it at full volume if it exists, or giving an error if not: llPlaySound("Applause", 1.0); // Plays a gunshot sound (unless a sound called 00000000-00 ... 0101 // already exists in the prim's inventory, in which case that sound // will be played instead). The volume will be half the maximum. llPlaySound("00000000-0000-0000-0000-000000000101", 0.5); ===== See also ===== * $lfn[llStopSound] stops a sound playing in this prim. * $lfn[llLoopSound] plays a looped sound in this prim. * $lfn[llLoopSoundMaster] plays a looped sound letting others synchronize with it. * $lfn[llLoopSoundSlave] plays a looped sound synchronized with a master. * $lfn[llPlaySoundSlave] plays a sound synchronized with a master. * $lfn[llAdjustSoundVolume] adjusts the volume of a sound playing in this prim. * $lfn[llSetSoundRadius] adjusts how far the prim sounds can be heard. * $lfn[llSetSoundQueueing] adjusts whether sounds are enqueued in this prim. * $lfn[llTriggerSound] "drops" a sound where the prim is. * $lfn[llTriggerSoundLimited] "drops" a sound where the prim is, with limited reach. * $lfn[llPreloadSound] causes a sound to be preloaded, for faster playing. * $lfn[llSound] plays a sound in this prim (deprecated - use $lfn[llPlaySound] instead). * $lfn[llSoundPreload] causes a sound to be preloaded (deprecated - use $lfn[llPreloadSound] instead). * $lart[Sound] (general information)