$nav
===== Function: llAdjustSoundVolume =====
llAdjustSoundVolume(float volume)
Change the volume of the $lart[sound] of the prim the script is in when it is already playing.
$delay[0.1]
===== Parameters =====
=== volume ===
A $lty[float] value indicating the new volume to set, between 0.0 and 1.0.
===== Notes =====
* Works only for $lfn[llPlaySound], $lfn[llLoopSound], and similar. Does not work for $lfn[llTriggerSound] or $lfn[llTriggerSoundLimited].
===== Short examples =====
llAdjustSoundVolume(0.2); // Sets the volume of a playing sound to 20% of the max.
===== Complete examples =====
The following script will start a looped $lart[sound] in the prim, then lower its volume every time it's clicked. When it gets to zero, it wraps around to maximum volume.
float vol = 1;
default
{
state_entry()
{
// Start the Jetpack looped sound
llLoopSound("67f5e4f0-0534-4d97-bc01-f297648d20e0", vol);
}
touch_start(integer n)
{
// Lower the volume of the sound, or go to full volume if already zero
vol -= 0.125;
if (vol < 0)
vol = 1;
llAdjustSoundVolume(vol);
}
}
===== See also =====
* $lfn[llStopSound] stops a sound playing in this prim.
* $lfn[llPlaySound] plays a sound 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[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)