OsStopSound

From OpenSimulator

Revision as of 06:57, 9 December 2020 by Ubit (Talk | contribs)

Jump to: navigation, search
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
// link 2 prims far from each other and place this script on root
//
 
string soundName;
integer power;
 
default
{
    state_entry()
    {
        // Get the first inventory sound name
        soundName = llGetInventoryName(INVENTORY_SOUND, 0);
 
        if (soundName == "")
        {
            llOwnerSay("Inventory sound missing ...");
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "Touch to see osStopSound usage.");
        }
    }
 
    touch_start(integer number)
    {
        if (power = !power)
        {
            osLoopSound(2, soundName, 1.0);
            osLoopSound(1, soundName, 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.


Personal tools
General
About This Wiki