Skip to content

llAdjustSoundVolume

void llAdjustSoundVolume(float Volume)

Adjusts the volume (0.0 - 1.0) of the currently playing attached sound.

This function has no effect on sounds started with llTriggerSound.

Parameters
Volume (float)
The volume to set.
  • This function has no effect on sounds started with llTriggerSound or llCollisionSound
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");
}
}
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);
}
}