Skip to content
lsl.devlsl.devLSL Dev

llAdjustSoundVolume

function
Function syntax
llAdjustSoundVolume(
  1. float volume// Volume level to set, between 0.0 (silent) and 1.0 (loud).
);
Delay
0.1 s
Energy
10

Adjusts the volume of the currently playing attached sound (has no effect on sounds started with llTriggerSound).

Adjusts volume of attached sound.

How to use
llAdjustSoundVolume(0.0);

Not work llTriggerSound and llCollisionSound

Example 1
default
{
state_entry()
{
llListen(42, "", llGetOwner(), "");
}
listen(integer chan, string name, key id, string msg)
{
float value = (float)msg;
llAdjustSoundVolume(value);
llOwnerSay("Volume set to: " + (string)value + " of 1.0");
}
}
Example 2
default
{
collision_start(integer p)
{
llPlaySound("5df2e97f-d3ab-9a80-7063-69007470a182", 1.0);
llAdjustSoundVolume(1.0);
llSetTimerEvent(0.2); //In 0.2 seconds, will reduce the volume of the currently playing audio.
}
timer(){
llAdjustSoundVolume(0.1);
llSetTimerEvent(0.0);
}
}

Added in SL 0.2.0

The original wiki page documents these functions together with this one:

Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.