# llLoopSound

*LSL function*

```lsl
void llLoopSound(string sound, float volume);
```

- `string sound`: Name of a sound in the prim's inventory, or a UUID.
- `float volume`: Volume level to set, between 0.0 (silent) and 1.0 (loud).

- Energy: 10

Plays the attached sound looping indefinitely at the specified volume. Only one sound can be attached to a prim at a time; new loops adjust the volume of the currently playing sound without restarting it.

Plays attached **sound** looping indefinitely at **volume**

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

## Caveats

- A call to `llLoopSound` replaces any other sound (so that only one sound can be played at the same time from the same prim, except sounds started with the deprecated [llSound](https://wiki.secondlife.com/wiki/LlSound) which always plays sound files till the end. An object can play 2 sounds with `llLoopSound` if the function is called from different prims
- If a second call to loop the same sound at a different volume is made from within the same script NO volume change is made.
- [llStopSound](/functions/llStopSound/) set just previous to the second call for a new volume allows the volume change with no discernible pause.
- When call made from HUD attachment sound is only heard by agent the task is attached to.

## Examples

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

```lsl
llLoopSound("ambient.wav", 0.5);
```

</details>

## History

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

## Known issues

From the issue templates included by the wiki article:

- SVC-4897 (nf): **llSetSyncTime**() - a function for synchronising client side effects

## See also

### Functions

- [llLoopSoundMaster](/functions/llLoopSoundMaster/) — 3=Plays a sound `attached` indefinitely.
- [llLoopSoundSlave](/functions/llLoopSoundSlave/)
- [llStopSound](/functions/llStopSound/) — 3=Stops playing a looped sound.
- [llPlaySound](/functions/llPlaySound/) — 3=Plays a sound `attached` once.
- [llTriggerSound](/functions/llTriggerSound/) — 3=Plays a sound `unattached`.
- [llTriggerSoundLimited](/functions/llTriggerSoundLimited/)

---

*Source: [LlLoopSound](https://wiki.secondlife.com/wiki/LlLoopSound) on the Second Life Wiki. Content from the Second Life Wiki articles LlLoopSound (revision 1210121, 2021-06-30), Template:Issues/SVC-4897 (revision 1050552, 2010-10-02) and Template:LSL Function/inventory (revision 1191151, 2014-06-07), CC BY-SA 3.0.*

---

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