Jump to content

Please Help with sound script


Nicole Hansome
 Share

You are about to reply to a thread that has been inactive for 4185 days.

Please take a moment to consider if this thread is worth bumping.

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 :-)

Link to comment
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!

Link to comment
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);
}}
Link to comment
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? :) 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4185 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...