Unofficial LSL Reference

[[functions:llplaysound]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

functions:llplaysound [2014-12-09 09:53 SLT]
sei Add the Sound article to See Also
functions:llplaysound [2015-06-28 11:12 SLT] (current)
sei remove plural
Line 6: Line 6:
 </​code>​ </​code>​
  
-Plays a [[lsl/sound]] once in the current prim.+Play $lart[sound] once in the current prim.
  
 ===== Parameters ===== ===== Parameters =====
  
 === sound === === sound ===
-The sound name, or a [[lsl/UUID]]. If it is a sound name, it must exist in the inventory of the prim.+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 === === volume ===
Line 19: Line 19:
  
   * The playing sound will move with the prim (if the prim moves, so will the sound).   * 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 [[llLoopSound|loop]] will stop, unless ​[[llSetSoundQueueing]] is set to TRUE. +  * 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 [[llTriggerSound]] and [[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. +    * 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 HUD, the sound started by **llPlaySound** will be heard only by the wearer. To play sounds from a HUD that can be heard by people around, use [[llTriggerSound]] or [[llTriggerSoundLimited]]. +  * If the prim belongs to a $lart[HUD], the sound started by $fn[llPlaySoundwill be heard only by the wearer. To play sounds from a $art[HUDthat can be heard by people around, use $lfn[llTriggerSound] or $lfn[llTriggerSoundLimited]. 
-  * If the sound is a [[lsl/UUID]], it doesn'​t need to be present in the prim. +  * 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 UUID of a sound different ​to it, the sound that will play is the one in the inventory, not the UUID. +  * If the name of a sound present in the prim's inventory matches the $art[UUIDof a different ​sound, the sound that will play is the one in the item, not the $art[UUID]
-  * If the name is not a UUID, and it is not present in the prim's inventory, an error will be shouted ​in DEBUG_CHANNEL.+  * 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 ===== ===== Short examples =====
  
 <code lsl2> <code lsl2>
-// Looks for a sound named "​Applause"​ in the prim'​s ​inventory,+// 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: // playing it at full volume if it exists, or giving an error if not:
 llPlaySound("​Applause",​ 1.0); llPlaySound("​Applause",​ 1.0);
  
-// Plays a gunshot sound (unless a sound called 00000000-...0101+// Plays a gunshot sound (unless a sound called 00000000-00 ... 0101
 // already exists in the prim's inventory, in which case that sound // already exists in the prim's inventory, in which case that sound
 // will be played instead). The volume will be half the maximum. // will be played instead). The volume will be half the maximum.
-llPlaySound("​00000000-0000-0000-000000000101",​ 0.5);+llPlaySound("​00000000-0000-0000-0000-000000000101",​ 0.5);
 </​code>​ </​code>​
  
 ===== See also ===== ===== See also =====
-  * [[llStopSound]] stops a sound playing in this prim. +  * $lfn[llStopSound] stops a sound playing in this prim. 
-  * [[llLoopSound]] plays a looped sound in this prim. +  * $lfn[llLoopSound] plays a looped sound in this prim. 
-  * [[llLoopSoundMaster]] plays a looped sound letting others synchronize with it. +  * $lfn[llLoopSoundMaster] plays a looped sound letting others synchronize with it. 
-  * [[llLoopSoundSlave]] plays a looped sound synchronized with a master. +  * $lfn[llLoopSoundSlave] plays a looped sound synchronized with a master. 
-  * [[llPlaySoundSlave]] plays a sound synchronized with a master. +  * $lfn[llPlaySoundSlave] plays a sound synchronized with a master. 
-  * [[llAdjustSoundVolume]] adjusts the volume of a sound playing in this prim. +  * $lfn[llAdjustSoundVolume] adjusts the volume of a sound playing in this prim. 
-  * <wrap important>​[[llSetSoundRadius]]</​wrap>​ adjusts how far the prim sounds can be heard. +  * <wrap important>​$lfn[llSetSoundRadius]</​wrap>​ adjusts how far the prim sounds can be heard. 
-  * [[llSetSoundQueueing]] adjusts whether sounds are enqueued in this prim. +  * $lfn[llSetSoundQueueing] adjusts whether sounds are enqueued in this prim. 
-  * [[llTriggerSound]] "​drops"​ a sound where the prim is. +  * $lfn[llTriggerSound] "​drops"​ a sound where the prim is. 
-  * [[llTriggerSoundLimited]] "​drops"​ a sound where the prim is, with limited reach. +  * $lfn[llTriggerSoundLimited] "​drops"​ a sound where the prim is, with limited reach. 
-  * [[llPreloadSound]] causes a sound to be preloaded, for faster playing. +  * $lfn[llPreloadSound] causes a sound to be preloaded, for faster playing. 
-  * [[lsl/Sound]] (general information)+  * <wrap important>​$lfn[llSound]</​wrap>​ plays a sound in this prim (deprecated - use $lfn[llPlaySound] instead). 
 +  * <wrap important>​$lfn[llSoundPreload]<​/wrap> causes a sound to be preloaded (deprecated - use $lfn[llPreloadSoundinstead). 
 +  * $lart[Sound] (general information)