# llLinkSetSoundRadius

*LSL function*

```lsl
void llLinkSetSoundRadius(integer link, float radius);
```

- `integer link`: Link number (1 for root, >1 for children) or a LINK_* flag.
- `float radius`: Maximum distance in meters at which the sounds can be heard.

- Energy: 10

Establishes a hard cut-off **radius** for audibility for [llPlaySound](/functions/llPlaySound/), [llLoopSound](/functions/llLoopSound/) and [llLinkPlaySound](/functions/llLinkPlaySound/) in non-triggered mode. Sounds are not heard until an observer's camera enters the radius, and immediately stop when leaving the radius. Volume fading is still determined by the distance from camera, not the radius.

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

## Caveats

- This function is a prim property, thus will survive script resets.
- Has no effect on [llTriggerSound](/functions/llTriggerSound/) or [llLinkPlaySound](/functions/llLinkPlaySound/) in triggered mode. Sounds will play regardless of camera position.
- [llTriggerSoundLimited](/functions/llTriggerSoundLimited/) can be used instead for a similar effect but the function depends on **avatar** position, not camera position.
- When used with [llPlaySound](/functions/llPlaySound/) or [llLinkPlaySound](/functions/llLinkPlaySound/) in non-looped mode, the sound will be played from the beginning only once, when the observer's camera enters the radius for the first time. This can happen significantly later than a one-off sound was actually played.
- With [llLoopSound](/functions/llLoopSound/) or [llLinkPlaySound](/functions/llLinkPlaySound/) in looped mode, the sound will be played from the beginning every time the observer's camera enters the radius.

## Examples

<details open>
<summary>Enable sound cutoff at 4 meters.</summary>

```lsl
llSetSoundRadius(4); //Enable sound cutoff at 4 meters.
```

</details>

<details>
<summary>Disable sound cutoff.</summary>

```lsl
llSetSoundRadius(0); //Disable sound cutoff.
```

</details>

## Notes

Pass 0 to this function to disable it.

## History

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

## Related functions

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

- [llSetSoundRadius](/functions/llSetSoundRadius/)

## Known issues

- [SVC-3058](https://jira.secondlife.com/browse/SVC-3058): Function: [llSetSoundRadius](/functions/llSetSoundRadius/)( float radius ); fails to limit sound to radius

## See also

### Functions

- [llTriggerSoundLimited](/functions/llTriggerSoundLimited/)

---

*Source: [LlSetSoundRadius](https://wiki.secondlife.com/wiki/LlSetSoundRadius) on the Second Life Wiki. Content from the Second Life Wiki articles LlSetSoundRadius (revision 1216713, 2024-05-24) and Template:LSL Function/link-face (revision 1186827, 2014-01-12), CC BY-SA 3.0.*

---

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