OsStopSound

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Created)
 
m (Add See Also)
 
(6 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
|threat_level=ignored
 
|threat_level=ignored
 
|permissions=true
 
|permissions=true
|delay=None
+
|delay=0
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
osStopSound(linknum);
+
//
 +
// osStopSound Script Example
 +
// Author: djphil
 +
// Usage: Link 2 prims far from each other and place this script and sounds on root
 +
//
 +
 
 +
string soundName_1;
 +
string soundName_2;
 +
integer power;
 +
 +
default
 +
{
 +
    state_entry()
 +
    {
 +
        // Get the first and the second inventory sound names
 +
        soundName_1 = llGetInventoryName(INVENTORY_SOUND, 0);
 +
        soundName_2 = llGetInventoryName(INVENTORY_SOUND, 1);
 +
 +
        if (soundName_1 == "" || soundName_2 == "")
 +
        {
 +
            llOwnerSay("Inventory sound(s) missing ...");
 +
        }
 +
 +
        else
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Touch to see osStopSound usage.");
 +
        }
 +
    }
 +
 +
    touch_start(integer number)
 +
    {
 +
        if (power = !power)
 +
        {
 +
            osLoopSound(1, soundName_1, 1.0);
 +
            osLoopSound(2, soundName_2, 1.0);
 +
        }
 +
 +
        else
 +
        {
 +
            osStopSound(LINK_SET);
 +
        }
 +
    }
 +
}
 
</source>
 
</source>
|description=Stop the sound playing in the specified prim of a linkset.
+
|description=Stop the sound playing in the specified prim or prims of a linkset
 
|additional_info=
 
|additional_info=
This function was added in 0.9.0.1
+
This function was added in 0.9.0.1.<br>
 +
Until 0.9.2 only one prim could be specified. Now it does handle all LINK_* constants and can stop sounds on several prims on according, note that on large link sets this can be very heavy.
 
}}
 
}}
 +
== See Also ==
 +
* [[osPlaySound]]
 +
* [[osLoopSound]]
 +
* [[osLoopSoundMaster]]
 +
* [[osLoopSoundSlave]]
 +
* [[osStopSound]]

Latest revision as of 06:59, 9 December 2020

osStopSound(integer linknum)
Stop the sound playing in the specified prim or prims of a linkset
Threat Level This function does not do a threat level check
Permissions Use of this function is always allowed by default
Extra Delay 0 seconds
Example(s)
//
// osStopSound Script Example
// Author: djphil
// Usage: Link 2 prims far from each other and place this script and sounds on root
//
 
string soundName_1;
string soundName_2;
integer power;
 
default
{
    state_entry()
    {
        // Get the first and the second inventory sound names
        soundName_1 = llGetInventoryName(INVENTORY_SOUND, 0);
        soundName_2 = llGetInventoryName(INVENTORY_SOUND, 1);
 
        if (soundName_1 == "" || soundName_2 == "")
        {
            llOwnerSay("Inventory sound(s) missing ...");
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "Touch to see osStopSound usage.");
        }
    }
 
    touch_start(integer number)
    {
        if (power = !power)
        {
            osLoopSound(1, soundName_1, 1.0);
            osLoopSound(2, soundName_2, 1.0);
        }
 
        else
        {
            osStopSound(LINK_SET);
        }
    }
}
Notes
This function was added in 0.9.0.1.

Until 0.9.2 only one prim could be specified. Now it does handle all LINK_* constants and can stop sounds on several prims on according, note that on large link sets this can be very heavy.


[edit] See Also

Personal tools
General
About This Wiki