Jump to content

Help with playing a sound more then 10 seconds


StarfruitNMangos
 Share

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

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

Recommended Posts

So i've been working with this code and it doesn't sem to work. Any suggestions?

list sound = ["Jaguarapart01", "jaguarapart02", "jaguarapart03", "jaguarapart04", "Jaguarapart05", "Jaguarapart06", "Jaguarapart07", "Jaguarapart08", "Jaguarapart09", "Jaguarapart10", "Jaguarapart11", "Jaguarapart12", "Jaguarapart13", "Jaguarapart14", "Jaguarapart15", "Jaguarapart16", "Jaguarapart17", "Jaguarapart18", "Jaguarapart19"]; integer index; // used to track which sound to play integer length; // used to cound number of sounds list ST = [9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0]; // Aproximate length of each sound default{ on_rez(integer start_param){ llResetScript(); } state_entry(){ llSetSoundQueueing( TRUE ); length = llGetListLength(sound); llSetTimerEvent( 0.0 ); } touch_end( integer vIntTch ){ if (index != 0){ llSay( 0, "wait for it to finish" ); }else if (index == 0){ llPlaySound( llList2String( sound, index ), 1.0 ); llSetTimerEvent(llList2Float( ST, index )); ++index; } } timer(){ if (index < (length-1)){ llPlaySound( llList2String( sound, index ), 1.0 ); llSetTimerEvent(llList2Float( ST, index )); ++index; }else{ llPlaySound( llList2String( sound, index ), 1.0 ); index = 0; llSetTimerEvent(0.0); } } }
Link to comment
Share on other sites

Like this?

 

list sound = ["jaguarapart01", "jaguarapart02", "jaguarapart03", "jaguarapart04", "jaguarapart05", "jaguarapart06", "jaguarapart07", "jaguarapart08", "jaguarapart09", "jaguarapart10", "jaguarapart11", "jaguarapart12", "jaguarapart13", "jaguarapart14", "jaguarapart15", "jaguarapart16", "jaguarapart17", "jaguarapart18", "jaguarapart19"];integer index; // used to track which sound to playinteger length; // used to cound number of soundslist ST = [9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 8.0, 9.0, 9.0, 9.0, 8.0, 9.0, 9.0, 9.0, 8.0]; // Aproximate length of each sound   default{    on_rez(integer start_param){        llResetScript();     }        state_entry(){        llSetSoundQueueing( TRUE );            length = llGetListLength(sound);         llSetTimerEvent( 0.0 );    }       touch_end( integer vIntTch ){        if (index != 0){            llSay( 0, "wait for it to finish" );        }else if (index == 0){                    llPlaySound( llList2String( sound, index ), 1.0 );            llSetTimerEvent(llList2Float( ST, index ));            ++index;        }    }      timer(){        if (index < (length-1)){            llPlaySound( llList2String( sound, index ), 1.0 );            llSetTimerEvent(llList2Float( ST, index ));            index = (++index%length);        }    }
Link to comment
Share on other sites

Where do I need to add it. I added it to the bottom using dreamweaver. 

 

list sound = ["jaguarapart01", "jaguarapart02", "jaguarapart03", "jaguarapart04", "jaguarapart05", "jaguarapart06", "jaguarapart07", "jaguarapart08", "jaguarapart09", "jaguarapart10", "jaguarapart11", "jaguarapart12", "jaguarapart13", "jaguarapart14", "jaguarapart15", "jaguarapart16", "jaguarapart17", "jaguarapart18", "jaguarapart19"];integer index; // used to track which sound to playinteger length; // used to cound number of soundslist ST = [9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 8.0, 9.0, 9.0, 9.0, 8.0, 9.0, 9.0, 9.0, 8.0]; // Aproximate length of each sound   default{    on_rez(integer start_param){        llResetScript();     }        state_entry(){        llSetSoundQueueing( TRUE );            length = llGetListLength(sound);         llSetTimerEvent( 0.0 );    }       touch_end( integer vIntTch ){        if (index != 0){            llSay( 0, "wait for it to finish" );        }else if (index == 0){                    llPlaySound( llList2String( sound, index ), 1.0 );            llSetTimerEvent(llList2Float( ST, index ));            ++index;        }    }      timer(){        if (index < (length-1)){            llPlaySound( llList2String( sound, index ), 1.0 );            llSetTimerEvent(llList2Float( ST, index ));            index = (++index%length);        }    } }
Link to comment
Share on other sites

That should do it.  Your viewer's editor will tell you if there are other syntax errors -- I don't see any myself -- and you'll be able to tell whether you're getting the results you expected as soon as you run the script in world. From there on, it's all trial and error tweaking.  That's what LSL scripters do.  Good luck.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3278 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...