Unofficial LSL Reference

[[articles:sound]]


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

articles:sound [2014-12-09 10:44 SLT]
sei created
articles:sound [2024-04-29 01:07 SLT] (current)
sei llPlaySound is not looped!
Line 2: Line 2:
 ===== Sound ===== ===== Sound =====
  
-<WRAP tip>This article is about the SL sound clips played directly by scripts, not about the per-parcel streaming audio. See [[Audio]] if you're looking for information on the latter.</​WRAP>​+<WRAP tip round>This article is about the SL sound clips played directly by scripts, not about the per-parcel streaming audio. See $lart[Audio] if you're looking for information on the latter.</​WRAP>​
  
-Sounds in SL are clips of 10.00 seconds or less. Inworld sounds ​use the WAV format, ​16 bit, mono, 44100 Hz, no compression. The currently accepted formats for uploading are:+Sounds in SL are clips of 10.00000 seconds or less. Inworld sounds ​are 16 bit, mono, 44100 Hz. The currently accepted formats for uploading are:
  
   * WAV, 44100 Hz, 16 bit, mono   * WAV, 44100 Hz, 16 bit, mono
   * WAV, 44100 Hz, 16 bit, stereo (which will be converted to mono)   * WAV, 44100 Hz, 16 bit, stereo (which will be converted to mono)
  
-Sounds are always attached to some kind of object, either a prim (for [[functions/llPlaySound]], [[functions/llLoopSound]], etc.) or an invisible object "​dropped"​ from a prim (for [[functions/llTriggerSound]] and [[functions/llTriggerSoundLimited]]). In the case of the latter, the sound will remain where the prim was at the moment of triggering, and will not move with the prim. These objects are viewer-side only, and will die when the sound stops. That means that using several [[functions/llTriggerSound]] calls, for example, will cause multiple sounds to be heard, without each of them stopping the former.+Sounds are always attached to some kind of object, either a prim (for $lfn[llPlaySound], ​$lfn[llLoopSound],​ etc.) or an invisible object "​dropped"​ from a prim (for $lfn[llTriggerSound] and $lfn[llTriggerSoundLimited]). In the case of the latter, the sound will remain where the prim was at the moment of triggering, and will not move with the prim. These objects are viewer-side only, and will die when the sound stops. That means that using several ​$lfn[llTriggerSound] calls, for example, will cause multiple sounds to be heard, without each of them stopping the former.
  
-Sounds started with [[functions/llTriggerSound]] or [[functions/llTriggerSoundLimited]] are called //detached sounds//, while sounds started with any other function ([[functions/llPlaySound]], [[functions/llLoopSound]], [[functions/llLoopSoundMaster]], etc.) will become part of the prim's properties, and are called //attached sounds//.+Sounds started with $lfn[llTriggerSound] or $lfn[llTriggerSoundLimited] are called //detached sounds//, while sounds started with any other function ($lfn[llPlaySound], ​$lfn[llLoopSound], ​$lfn[llLoopSoundMaster],​ etc.) will become part of the prim's properties, and are called //attached sounds//.
  
-When a detached sound is triggered from an attachment, the invisible object will be "​dropped"​ inworld, where the avatar is. In the case of HUDs, this means they can be heard by anyone, as opposed to attached sounds in HUDs, which can only be heard by the wearer.+When a detached sound is triggered from an attachment, the invisible object will be "​dropped"​ inworld, where the avatar is. In the case of HUDs, this means that detached sounds ​can be heard by anyone, as opposed to attached sounds in HUDs, which can only be heard by the wearer
 + 
 +The source of the sound is located at that object. The closer to the source, the more intense the sound. If the object moves, a Doppler effect is applied (i.e. the pitch is higher as the object gets closer to the camera, and lower as it gets farther).
  
 ===== Functions related to Sound ===== ===== Functions related to Sound =====
  
-  * [[llPlaySound]] plays a looped ​sound attached to this prim. +  * $lfn[llPlaySound] plays a sound attached to this prim. 
-  * [[llStopSound]] stops an attached sound playing in this prim. +  * $lfn[llStopSound] stops an attached sound playing in this prim. 
-  * [[llLoopSound]] plays a looped sound attached to this prim. +  * $lfn[llLoopSound] plays a looped sound attached to this prim. 
-  * [[llLoopSoundMaster]] plays a looped sound attached to this prim, letting others synchronize with it. +  * $lfn[llLoopSoundMaster] plays a looped sound attached to this prim, letting others synchronize with it. 
-  * [[llLoopSoundSlave]] plays a looped sound attached, synchronized with a master. +  * $lfn[llLoopSoundSlave] plays a looped sound attached, synchronized with a master. 
-  * [[llPlaySoundSlave]] plays an attached sound synchronized with a master. +  * $lfn[llPlaySoundSlave] plays an attached sound synchronized with a master. 
-  * [[llAdjustSoundVolume]] adjusts the volume of a sound attached to this prim. +  * $lfn[llAdjustSoundVolume] adjusts the volume of a sound attached to this prim. 
-  * <wrap important>​[[llSetSoundRadius]]</​wrap>​ adjusts how far the attached sounds can be heard. +  * <wrap important>​$lfn[llSetSoundRadius]</​wrap>​ adjusts how far the attached sounds can be heard. 
-  * [[llSetSoundQueueing]] adjusts whether attached sounds are enqueued in this prim. +  * $lfn[llSetSoundQueueing] adjusts whether attached sounds are enqueued in this prim. 
-  * [[llTriggerSound]] "​drops"​ a sound where the prim is (plays a detached sound). +  * $lfn[llTriggerSound] "​drops"​ a sound where the prim is (plays a detached sound). 
-  * [[llTriggerSoundLimited]] "​drops"​ a sound where the prim is (plays a detached sound), with limited reach. +  * $lfn[llTriggerSoundLimited] "​drops"​ a sound where the prim is (plays a detached sound), with limited reach. 
-  * [[llPreloadSound]] causes a sound to be preloaded, for faster playing, irrespective of whether it will be played as attached or detached. +  * $lfn[llPreloadSound] causes a sound to be preloaded, for faster playing, irrespective of whether it will be played as attached or detached. 
-  * <wrap important>​[[llSound]]</​wrap>​ plays a sound attached to this prim (deprecated - use [[llPlaySound]] instead). +  * <wrap important>​$lfn[llSound]</​wrap>​ plays a sound attached to this prim (deprecated - use $lfn[llPlaySound] instead). 
-  * <wrap important>​[[llSoundPreload]]</​wrap>​ causes a sound to be preloaded (deprecated - use [[llPreloadSound]] instead).+  * <wrap important>​$lfn[llSoundPreload]</​wrap>​ causes a sound to be preloaded (deprecated - use $lfn[llPreloadSound] instead).