llSetSoundRadius
function
Function syntax
llSetSoundRadius(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, llLoopSound and 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.
llSetSoundRadius(0.0);Caveats
Section titled “Caveats”- This function is a prim property, thus 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 a 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.
Examples
Section titled “Examples”Enable sound cutoff at 4 meters.
llSetSoundRadius(4); //Enable sound cutoff at 4 meters.Disable sound cutoff.
llSetSoundRadius(0); //Disable sound cutoff.Pass 0 to this function to disable it.
History
Section titled “History”Added in SL 0.4.0
Related functions
Section titled “Related functions”The original wiki page documents these functions together with this one:
Known issues
Section titled “Known issues”- SVC-3058: Function:
llSetSoundRadius( float radius ); fails to limit sound to radius
See also
Section titled “See also”Functions
Section titled “Functions”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.