Difference between revisions of "LlSetSoundQueueing"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 12: Line 12:
*Sound queuing is a property of the prim, not the script. It can be activated and deactivated by any script in the prim and survives script reset, rerez and script removal.
*Sound queuing is a property of the prim, not the script. It can be activated and deactivated by any script in the prim and survives script reset, rerez and script removal.
*If used to make smooth transitions using slave/master sounds the sounds tend to go out of sync.
*If used to make smooth transitions using slave/master sounds the sounds tend to go out of sync.
*There is a very small (but clearly audible) gap of silence between sounds which causes a clicking noise if used with sounds designed to be perfectly sequential (e.g. music). In these cases, you may have to use a timer/sleep set to ~0.05 seconds less than the sound's length, and just interrupt it with another llPlaySound. This lessens clicking noises, but sometimes "jumps" a bit - this is still audibly cleaner, however.
*There is a very small (but audible) gap of silence between sounds due to network latency and processing time.
**If you are using sounds that won't be seriously affected by a gap of silence, e.g. sounds that fade in/out to 0dB at the start/end, then this function is definitely better than a timer.
*The queued sound must be fully loaded in the viewer, or else it will not play. [[llPreloadSound]] is not always reliable in doing its job.
*Queueing a sound that is identical to the one currently playing will fail. Use [[llLoopSound]] instead.
|constants
|constants
|examples=
|examples=

Revision as of 16:43, 15 February 2013

Summary

Function: llSetSoundQueueing( integer queue );

Set whether attached sounds wait for the current sound to finish. If queue is TRUE, queuing is enabled, if FALSE queuing is disabled. Sound queuing is disabled by default.

• integer queue boolean, sound queuing: TRUE enables, FALSE disables (default)

Caveats

  • It appears that only two sounds can be queued per prim. SVC-4260
  • Sound queuing is a property of the prim, not the script. It can be activated and deactivated by any script in the prim and survives script reset, rerez and script removal.
  • If used to make smooth transitions using slave/master sounds the sounds tend to go out of sync.
  • There is a very small (but audible) gap of silence between sounds due to network latency and processing time.
  • The queued sound must be fully loaded in the viewer, or else it will not play. llPreloadSound is not always reliable in doing its job.
  • Queueing a sound that is identical to the one currently playing will fail. Use llLoopSound instead.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl> default {

   state_entry()
   {
       llPreloadSound("SoundName1");//This loads the sounds into all in range viewers and cuts delay between sounds.
       llPreloadSound("SoundName2");//All sound parameters can be the name of a sound in the prim's inventory or a UUID of a sound");
   }
   touch_start(integer detected)
   {
       llSetSoundQueueing(TRUE);//Set to TRUE for queueing and SoundName2 plays after the SoundName1 has ended.
       //Set to FALSE only the second will be played since the prim has only one sound emmiter and the second was called last.
       //Can be set anywhere withing the script (if within an event it will activate when the event is triggered.
       llPlaySound("SoundName1", 1.0);
       llPlaySound("SoundName2", 1.0);
   }

}

</lsl>

See Also

Functions

•  llLoopSound
•  llLoopSoundSlave Plays a sound attached.

Deep Notes

All Issues

~ Search JIRA for related Issues
   Since llSetSoundQueueing only allows two sounds to be played in queue can it be changed to allow more?

Signature

function void llSetSoundQueueing( integer queue );