llSetSoundRadius
void llSetSoundRadius(float Radius)Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius.
Parameters
-
Radius(float) - Maximum distance that sounds can be heard.
Enable sound cutoff at 4 meters:
llSetSoundRadius(4);Disable sound cutoff:
llSetSoundRadius(0);Caveats
Section titled “Caveats”- This function is a prim property and will survive script resets.
- Has no effect on
llTriggerSoundorllLinkPlaySoundin triggered mode. Sounds will play regardless of camera position.llTriggerSoundLimitedcan be used instead for a similar effect, but the function depends on avatar position, not camera position.
- When used with
llPlaySoundorllLinkPlaySoundin 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 when the one-off sound was actually played. - With
llLoopSoundorllLinkPlaySoundin looped mode, the sound will be played from the beginning every time the observer’s camera enters the radius.
- Volume fading is still determined by the distance from camera, not the radius.
- Pass 0 to this function to disable it.