Jump to content
Sign in to follow this  
Nicole Hansome

Please Help with sound script

Recommended Posts

Hi all :)

For Halloween i had a short mp3 file which i converted to wav. format and then split it into 4 parts..

Now i wanted to play these 4 soundfiles seamless in a row when someone touches the object. I usually had such a script in my inventory it'S a freebie but unfortunately i cannot find it any more :(

I have found a pretty long script which does it,  but it's not what i'm searching for because it will preload all files too long before starting with the first sound at all..


So im starting over right now.. I have found this one here .. that works very well, starting immediately when touching the object, but works only with 2 files.. Thats the Limit for a single object.. What do i need to change to play my 4 files in a row ?

default
{
    state_entry()
    {
        llPreloadSound("Sound1");
        llPreloadSound("Sound2");

    }
    touch_start(integer detected)
    {
        llSetSoundQueueing(TRUE);
        llPlaySound("Sound1", 1.0);
        llPlaySound("Sound 2", 1.0);

    }
}

 

 Thanks very much :-)

Share this post


Link to post
Share on other sites

Try going like this:

default{    state_entry()    {        llPreloadSound("Sound1");        llPreloadSound("Sound2");

llPreloadSound("Sound3");

llPreloadSound("Sound4");

} touch_start(integer detected) { llSetSoundQueueing(TRUE); llPlaySound("Sound1", 1.0); llPlaySound("Sound2", 1.0);

llPlaySound("Sound3", 1.0);

llPlaySound("Sound4", 1.0);

}}

 

This way of doing it can have some glitches or hiccups, but hopefully for your situation it'll work out!

Share this post


Link to post
Share on other sites

OK!  Then we could go like this:

 

default{    state_entry()    {        llPreloadSound("Sound1");        llPreloadSound("Sound2");
llPreloadSound("Sound3");
llPreloadSound("Sound4");
} touch_start(integer detected) { llSetSoundQueueing(TRUE); llPlaySound("Sound1", 1.0); llPlaySound("Sound2", 1.0);
// By the time it gets here, S1 is playing and S2 is queued waiting to start.
// Let's put a pause in here before the last two sounds get queued
// If Sound1 and Sound2 are both 10sec, then we need a pause of about 20 secs, whilst they're playing
llSleep(19.0);
//Waiting done, queue the last two sounds...
// S2 is just finishing playing, so we can queue up the next one
llPlaySound("Sound3", 1.0);
llSleep(9.0);
llPlaySound("Sound4", 1.0);
}}

Share this post


Link to post
Share on other sites


Vegro Solari wrote:

OK!  Then we could go like this:

 
default{    state_entry()    {        llPreloadSound("Sound1");        llPreloadSound("Sound2");

llPreloadSound("Sound3");

llPreloadSound("Sound4");

} touch_start(integer detected) { llSetSoundQueueing(TRUE); llPlaySound("Sound1", 1.0); llPlaySound("Sound2", 1.0);

// By the time it gets here, S1 is playing and S2 is queued waiting to start.

// Let's put a pause in here before the last two sounds get queued

// If Sound1 and Sound2 are both 10sec, then we need a pause of about 20 secs, whilst they're playing

llSleep(19.0);

//Waiting done, queue the last two sounds...

// S2 is just finishing playing, so we can queue up the next one

llPlaySound("Sound3", 1.0);

llSleep(9.0);

llPlaySound("Sound4", 1.0);

}}

 

Sheesh ... i paid for one of these scripts! it pays to look here in advance, huh? :) 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...