Skip to content
lsl.devlsl.devLSL Dev

llLinkAdjustSoundVolume

function
Function syntax
llLinkAdjustSoundVolume(
  1. integer link,// Link number (1 for root, >1 for children) or a LINK_* flag of the prim to adjust. Values: Links
  2. float volume// Volume level to set, between 0.0 (silent) and 1.0 (loud).
);
Energy
10

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

Adjusts volume of attached sound.

How to use
llLinkAdjustSoundVolume(0, 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.