# llAdjustSoundVolume

*LSL function*

```lsl
void llAdjustSoundVolume(float volume);
```

- `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.

```lsl title="How to use" frame="terminal"
llAdjustSoundVolume(0.0);
```

## Caveats

Not work [llTriggerSound](/functions/llTriggerSound/) and [llCollisionSound](/functions/llCollisionSound/)

## Examples

<details open>
<summary>Example 1</summary>

```lsl
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");
    }
}
```

</details>

<details>
<summary>Example 2</summary>

```lsl
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);
    }
}
```

</details>

## History

Added in [SL 0.2.0](http://secondlife.wikia.com/wiki/Version_0.2.0)

## Related functions

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

- [llLinkAdjustSoundVolume](/functions/llLinkAdjustSoundVolume/)

## See also

### Functions

- [llLinkPlaySound](/functions/llLinkPlaySound/)
- [llLinkSetSoundQueueing](/functions/llLinkSetSoundQueueing/)
- [llLinkSetSoundRadius](/functions/llLinkSetSoundRadius/)
- [llLinkStopSound](/functions/llLinkStopSound/)
- [llLoopSound](/functions/llLoopSound/)
- [llLoopSoundMaster](/functions/llLoopSoundMaster/)
- [llLoopSoundSlave](/functions/llLoopSoundSlave/)
- [llPlaySound](/functions/llPlaySound/)
- [llPlaySoundSlave](/functions/llPlaySoundSlave/)
- [llPreloadSound](/functions/llPreloadSound/)
- [llSetSoundQueueing](/functions/llSetSoundQueueing/)
- [llSetSoundRadius](/functions/llSetSoundRadius/)
- [llStopSound](/functions/llStopSound/)
- [llTriggerSound](/functions/llTriggerSound/)
- [llTriggerSoundLimited](/functions/llTriggerSoundLimited/)

---

*Source: [LlAdjustSoundVolume](https://wiki.secondlife.com/wiki/LlAdjustSoundVolume) on the Second Life Wiki. Content from the Second Life Wiki articles LlAdjustSoundVolume (revision 1216420, 2024-03-27), Template:LSL Function/volume (revision 1168834, 2012-06-11) and Template:LSL Function/link-face (revision 1186827, 2014-01-12), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llAdjustSoundVolume/
