Play sound while typing

Expired

default
{
    link_message(integer from, integer num, string action, key id)
    {
        if(action == "anim")
        {
            llLoopSound("25365198-05c6-c97b-c849-e5573fe38d92",1);
        }
        if(action == "stop")
        {
            llStopSound();
        }
    }
}

 

Ambient sound

Expired

// Ambient Sound script by Alfkin Small.
 
// To use: Place this script in the object that you want to play a sound.
// The object need not be special.  Just place is where you want the sound
// to come from.
// Drop a sound file in the object, then change the key sound line below to
// the name of your sound file.
// If you like, you can set the min and max values as well, in addition to
// the volume.  That's all there is to it!
 
// Set debug to TRUE if you'd like to get debugging messages, otherwise
// leave the next line alone.
integer debug = FALSE;
 
// Minimum amount of time (in seconds) between sounds.
float min = 10;
 
// Maximum amount of time (in seconds) between sounds.
float max = 30;
 
// This is the volume at which the sound will play.  0 = Inaudible
// Valid values are between 0.0 - 1.0
float vol = 0.5;
 
// Sound to play.
key sound = "dolphin1.wav";
 
default
{
    state_entry()
    {
        if (debug) llSay(0, "Debugging is ON");
 
        // Set the initial timer
        llSetTimerEvent(5.0);
    }
    timer()
    {
        // Play the sound once
        llPlaySound(sound, vol);
 
        // Randomly select the next time (in seconds) to play the sound.
        float time = min + llFrand(max - min);
 
        if (debug) llSay(0, "Time set to" + (string)time);
 
        llSetTimerEvent(time);
    }
}

 

Old Car Honk

Expired

For other grids, you will need to upload the sound and replace the key in the script withthe UUID key of the newly uploaded sound.

default
{
 
    touch_start(integer total_number)
    {
        llTriggerSound("959e846a-237f-26ac-4e30-fab5380c7994", 99.0);
    }
}

 

Play Script (with sound files)

Expired

integer nombre ;
integer numero;
 
default {
    state_entry() {
        // lorsque le script passe dans son état par défaut.
        // un “OFF” rouge apparaît au dessus de la prim
        llSetText("", <1 ,0,0>, 1.0);
        llSetPrimitiveParams([ PRIM_FULLBRIGHT, ALL_SIDES ,FALSE]);
        nombre = llGetInventoryNumber(INVENTORY_SOUND);
         llStopSound();
    }
    touch_start(integer num_detected) {
        // quand la prim est touchée, le script passe dans l’état 'on'
        state on;
    }
}
 
state on {
    state_entry() {
        // Lit ce code lorsque le script passe dans l’état ‘on’
        // un "ON" vert apparaît au dessus de la prim
        llSetPrimitiveParams([ PRIM_FULLBRIGHT, ALL_SIDES ,FALSE]);
 
        numero = 0;
        llSetSoundQueueing(TRUE);
        llSetTimerEvent(0.01);
 
    }
    timer()
    {
        llSetTimerEvent(10.0);
        llTriggerSound(llGetInventoryName(INVENTORY_SOUND,numero), 99.5);
        numero = numero + 1;
        if(numero>= nombre) numero = 0;
        llPreloadSound(llGetInventoryName(INVENTORY_SOUND, numero));        
 
    }
    touch_start(integer num_detected) {
        // quand la prim est touchée, le son s’arrrête et le script retourne dans son état par défaut
        llStopSound();
        state default;
    }
}