sound script error

Creating scripts
Post Reply
User avatar
Constance Peregrine
Posts: 2333
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2769 times
Been thanked: 1443 times

sound script error

Post by Constance Peregrine »

Trying out a new script I got and it doesn't work in kitely or my opensim region, so I thought I would throw it out here for you folx...maybe someone will be able to fix it and use it-))

[01:12 PM] multi sound test: Runtime error:
(0): Command not implemented: llSetSoundQueueing

is the error

Code: Select all

// Script Name: 42_minute_Music_Box.lsl
// Author: Ferd Frederix
//Plays up to 42 minutes of music or sounds when an avatar walks near. May be set to always play, too.

// Downloaded from : http://www.free-lsl-scripts.com/cgi/freescripts.plx?ID=1681

// This program is free software; you can redistribute it and/or modify it.
// Additional Licenes may apply that prevent you from selling this code
// and these licenses may require you to publish any changes you make on request.
//
// There are literally thousands of hours of work in these scripts. Please respect
// the creators wishes and Copyright law and follow their license requirements.
//
// License information included herein must be included in any script you give out or use.
// Licenses may also be included in the script or comments by the original author, in which case
// the authors license must be followed, and  their licenses override any licenses outlined in this header.
//
// You cannot attach a license to any of these scripts to make any license more or less restrictive.
//
// All scripts by avatar Ferd Frederix, unless stated otherwise in the script, are licensed as Creative Commons By Attribution and Non-Commercial.
// Commercial use is NOT allowed - no resale of my scripts in any form.  
// This means you cannot sell my scripts but you can give them away if they are FREE.  
// Scripts by Ferd Frederix may be sold when included in a new object that actually uses these scripts. Putting my script in a prim and selling it on marketplace does not constitute a build.
// For any reuse or distribution, you must make clear to others the license terms of my works. This is done by leaving headers intact.
// See http://creativecommons.org/licenses/by-nc/3.0/ for more details and the actual license agreement.
// You must leave any author credits and any headers intact in any script you use or publish.
///////////////////////////////////////////////////////////////////////////////////////////////////
// If you don't like these restrictions and licenses, then don't use these scripts.
//////////////////////// ORIGINAL AUTHORS CODE BEGINS ////////////////////////////////////////////

// Script Name: Standalone Music player, with sensor trigger
// 10-09-2012 by Ferd Frederix

// May be triggered to run continually, start it by touching it or use the sensor script when someone gets nearby.

// This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
// http://creativecommons.org/licenses/by-nc/3.0/deed.en_US
// This script cannot be sold even as part of another object, it must always remain free and fully modifiable.

// Drop 10 second song clips in the inventory of the obect, and touch to play.
// A great free tool to make these files is the slice audio file splitter at http://www.nch.com.au/splitter/index.html
// Set the variable loop = TRUE to loop after reaching the end, set it to FALSE to play once.

// Scriptable Control:
// Send a link message string of 'play' and 'stop' for use with external control scripts.
// Or just touch the prim to play

integer loop = FALSE;                // set to TRUE to loop again and again
float set_text_alpha = 1;            // the text transparency fo alpha text. Set this to 0 to disable hovertext

// Stuff that you should not mess with:

integer debugflag = TRUE;           // chat debug info to owner if TRUE
integer waves_to_preload = 3;       // wave files to Preload ahead of the wav being played.
float preload_load_time = 0.5;      // seconds pause between each preloaded wave file attempt b4 play comnences
integer secret_channel = 54345;     // just a magic number
vector set_text_colour = <1,1,1>;   // colour of floating text label ( white)
float timer_interval = 9.8;         // time interval between requesting server to play the next 10 second wave
// times just below 10 seconds are suitable as we use sound queueing
integer total_wave_files;           // number of wave files
integer i_playcounter;              // used by timer() player
string preloading_wave_name;        // the name of the wave file being preloaded
string playing_wave_name;           // the name of the wave being played


DEBUG (string msg)
{
    if (debugflag) llOwnerSay(msg);
}


go(integer play) {

    if (play)
    {
        sound();

    } else {
            llSetTimerEvent(0.0);
        llStopSound();
        DEBUG("Stoped");
        llSetText(llGetObjectName() + "\n.", <0,1,0>, set_text_alpha);
    }
}



sound() {


    total_wave_files = llGetInventoryNumber(INVENTORY_SOUND);
    integer counter = 0;        //do full preload of sound
    llSetSoundQueueing(TRUE); // only works on llPlaySound not llTriggerSound, so we can queue these silently
    integer local_total_wave_files = total_wave_files -1 ;

    float length = total_wave_files * 10.0;
    for (counter = 0 ; counter < waves_to_preload ; counter++)  //preload X wave files b4 we play
    {
        //since wavs are numbered from 0 we minus 1
        preloading_wave_name = llGetInventoryName(INVENTORY_SOUND, counter);


        llSetText(llGetObjectName()
            + "Preload wav: " + (string)counter +"\n."
            + " name: " + preloading_wave_name
            +"\n.", <1,0,0>, set_text_alpha);
        //Attempt to preload first x wave files to local machines cache!
        llPreloadSound(preloading_wave_name);


        DEBUG("Preloading wav: " + (string)counter + " " + (string)llGetInventoryKey(preloading_wave_name));
        //start play sound timer in 'timer_interval' seconds when we are less than 'timer_interval' seconds from
        // finishing preloading.
        llSleep(preload_load_time);

    }
    llSetTimerEvent(0.1);   // start playing
    i_playcounter=0;
    counter=0;
}


default
{
    state_entry()
    {
        //set text above object to the name of the object
        llSetText(llGetObjectName() + "\n.", <0,1,0>, set_text_alpha);
    }

    touch_start(integer total_number)
    {
        go(TRUE);
    }

    timer()
    {
        llSetTimerEvent(timer_interval);
        if( i_playcounter > (total_wave_files -1) )
        {
            if (!loop)
            {
                llSetTimerEvent(0);
            }
            else
            {
                sound();
            }

        }  else {
                playing_wave_name = llGetInventoryName(INVENTORY_SOUND, i_playcounter);
            DEBUG("llPlaySound wav: " + (string)i_playcounter + " " + playing_wave_name );

            llPlaySound(playing_wave_name, 1.0);
            llSetText(  llGetObjectName() + "\n(playing " + (string)i_playcounter +" of "+ (string)(total_wave_files -1) +")\n.", <0,1,1>, set_text_alpha);
            if(i_playcounter + waves_to_preload <= (total_wave_files -1))
            {
                preloading_wave_name = llGetInventoryName(INVENTORY_SOUND, i_playcounter + waves_to_preload);
                llSetText("Playing " + (string)i_playcounter + " of " + (string)(total_wave_files -1) , set_text_colour, set_text_alpha);

                DEBUG("Preloading wav:" + (string)(i_playcounter + waves_to_preload) + "\n" +
                    (string) llGetInventoryKey(preloading_wave_name) +  "\n" +
                    " name: " + preloading_wave_name +  "\n" +
                    "Preloading sequence: " + (string)(i_playcounter + waves_to_preload));


                llPreloadSound(llGetInventoryName(INVENTORY_SOUND, i_playcounter + waves_to_preload));
            }
        }
        i_playcounter++;     //increment for next wave file in sequence!
    }

    link_message(integer sender_number, integer number, string message, key id)
    {
        if (message == "play")
        {
            go(TRUE);
        }
        else if (message == "stop")
        {
            go(FALSE);
        }
    }

    on_rez(integer param)
    {
        llResetScript();
    }
}





Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
Graham Mills
Posts: 1074
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 719 times
Been thanked: 843 times

Re: sound script error

Post by Graham Mills »

Alas, that function hasn't been implemented in OpenSim LSL

http://opensimulator.org/wiki/LSL_Status/Functions
User avatar
Constance Peregrine
Posts: 2333
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2769 times
Been thanked: 1443 times

Re: sound script error

Post by Constance Peregrine »

Graham Mills wrote:Alas, that function hasn't been implemented in OpenSim LSL

http://opensimulator.org/wiki/LSL_Status/Functions
ah..I kinda figured that. The scriptor had mentioned his were good in sl and opensim but I do know some of these things are different and that they change.

I don't script so it is difficult to find current stuffs on that for me. I did find a scriptor, in the meantime, who says he will look into it and maybe find a workaround, and if so, that would be a very useful script and I will definitely pass it around.
Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
User avatar
Constance Peregrine
Posts: 2333
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2769 times
Been thanked: 1443 times

found a good one

Post by Constance Peregrine »

I finally was given a wonderful multi-sound script...I tested it and it has several options to customize it...enjoy-))

Code: Select all

list daySounds = ["American Oriole", "Bird", "Bird-flicker", "Bird01", "Bird02", "Cardinal", "Cricket", "Great Horned Owl", "Locust", "Red-tailed Hawk", "Red-tailed Hawk 1", "Robin", "Robin 1", "Song Sparrow", "Tree Swallow", "Tree Swallow 1", "Locust"];
list nightSounds = ["Great Horned Owl"];

list nightAmbient = ["Cricket" , "Great Horned Owl"];

default {
    state_entry() {
        llStopSound();
        llSetTimerEvent(2.0);
    }

    timer() {
        vector time = llGetSunDirection();
        list myList;
        float density = 0.9;

        if (time.z > 0.0) {
            myList = llListRandomize(daySounds, 1);
        } else {
            myList = llListRandomize(nightSounds, 1);
            density = 0.98;
            
            // Ambient nighttime sound
            if (llFrand(1.0) > 0.85) {
                llStopSound();
            } else {
                llLoopSound(llList2String(nightAmbient, 0), 1.0);
            }
        }
        
        if (llFrand(1.0) > density) {
            llTriggerSound(llList2String(myList, 0), 1.0);
        }
    }
}
Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
Graham Mills
Posts: 1074
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 719 times
Been thanked: 843 times

Re: sound script error

Post by Graham Mills »

Apparently llSetSoundQueueing() has now been implemented and will presumably arrive in Kitely in due course.
These users thanked the author Graham Mills for the post:
Constance Peregrine
Mikki Miles
Posts: 5
Joined: Sat Aug 17, 2013 11:22 am
Has thanked: 1 time
Been thanked: 12 times

Re: sound script error

Post by Mikki Miles »

Graham Mills wrote:Apparently llSetSoundQueueing() has now been implemented and will presumably arrive in Kitely in due course.
Oh, that would be great!
User avatar
Dot Matrix
Posts: 1575
Joined: Sun Jul 28, 2013 3:26 am
Has thanked: 1092 times
Been thanked: 2184 times

Re: sound script error

Post by Dot Matrix »

Welcome, Mikki! :)

Mikki makes wonderful musical instruments. One happy customer here...
Mikki Miles
Posts: 5
Joined: Sat Aug 17, 2013 11:22 am
Has thanked: 1 time
Been thanked: 12 times

Re: sound script error

Post by Mikki Miles »

yeah, just dropped in...
I think I will import some of my stuff, needs some sound here ;)
These users thanked the author Mikki Miles for the post (total 2):
Constance PeregrineDot Matrix
User avatar
Constance Peregrine
Posts: 2333
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2769 times
Been thanked: 1443 times

Re: sound script error

Post by Constance Peregrine »

Welcome Mikka-))

And since this thread was revived, it reminded me I found another cool script recently...untested in Kitely yet though...I did test it in 7.5 OS in my soas and it worked fine.

Code: Select all

// Script Name: Sound_Prim_Script_-_Intermittent.lsl
// Author: Anonymous
//Intermittent sound play

// Downloaded from : http://www.free-lsl-scripts.com/cgi/freescripts.plx?ID=1156

// This program is free software; you can redistribute it and/or modify it.
// Additional Licenes may apply that prevent you from selling this code
// and these licenses may require you to publish any changes you make on request.
//
// There are literally thousands of hours of work in these scripts. Please respect
// the creators wishes and Copyright law and follow their license requirements.
//
// License information included herein must be included in any script you give out or use.
// Licenses may also be included in the script or comments by the original author, in which case
// the authors license must be followed, and  their licenses override any licenses outlined in this header.
//
// You cannot attach a license to any of these scripts to make any license more or less restrictive.
//
// All scripts by avatar Ferd Frederix, unless stated otherwise in the script, are licensed as Creative Commons By Attribution and Non-Commercial.
// Commercial use is NOT allowed - no resale of my scripts in any form.  
// This means you cannot sell my scripts but you can give them away if they are FREE.  
// Scripts by Ferd Frederix may be sold when included in a new object that actually uses these scripts. Putting my script in a prim and selling it on marketplace does not constitute a build.
// For any reuse or distribution, you must make clear to others the license terms of my works. This is done by leaving headers intact.
// See http://creativecommons.org/licenses/by-nc/3.0/ for more details and the actual license agreement.
// You must leave any author credits and any headers intact in any script you use or publish.
///////////////////////////////////////////////////////////////////////////////////////////////////
// If you don't like these restrictions and licenses, then don't use these scripts.
//////////////////////// ORIGINAL AUTHORS CODE BEGINS ////////////////////////////////////////////

// CATEGORY:Sound
// DESCRIPTION:Intermittent sound play
// ARCHIVED BY:Ferd Frederix


// Sound Prim Script - Intermittent
//
// Randomly picks a sound in contents, plays it,
// waits a random interval, repeats.
//
// Set this between 0.0 and 1.0
float LOUDNESS = 1.0;
//
// Interval in seconds to be silent.
// If you set these to be less than 10 seconds,
// they default to 10 seconds.
integer SHORTEST = 10;
integer LONGEST = 40;
//
////////////////////////////////////////////////
default
{

state_entry()
{
    if (SHORTEST < 10 )     SHORTEST = 10;
    if (LONGEST < 10 )      LONGEST = 10;
    if (SHORTEST > LONGEST) SHORTEST = LONGEST;

    llSleep( 1.0 );    
    state noisy;
}

on_rez(integer start_param)
{
    llSleep( 1.0 );
    state noisy;
}

}
////////////////////////////////////////////////
state noisy
{

state_entry()
{
    integer sounds = llGetInventoryNumber(INVENTORY_SOUND);

    if ( sounds <= 0 ) state default;

    string soundname = llGetInventoryName( INVENTORY_SOUND, llFloor(llFrand(sounds)) );
    if ( soundname != "" )
    {
        llPlaySound( soundname, LOUDNESS );
    }
    
    state silent;
}

on_rez(integer start_param)
{
    state default;
}

}
////////////////////////////////////////////////
state silent
{

state_entry()
{    
    llSleep( (float)(llFloor(llFrand(LONGEST - SHORTEST)) + SHORTEST) );
    state noisy;
}

on_rez(integer start_param)
{
    state default;
}

}

// END //


Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
Post Reply