Play sound every 60 seconds
|
|
Oshi Leakey
Registered User
Join date: 21 Jan 2008
Posts: 10
|
10-02-2008 11:28
Hey guys!
I would like to play a 30 second sound clip every minute (for a belltower).
It seems to work, except it doesnt play the third sound, clock_03. The first two play but not the third. If I edit out clock_02, it plays clock_03, so I am stumped. Does SetSoundQueueing only work for 2 stitched audio files?
Here is my code:
default{ state_entry(){ llSetTimerEvent(60); } timer(){ llSetSoundQueueing(TRUE); llPlaySound("clock_01", 1); llPlaySound("clock_02", 1); llPlaySound("clock_03", 1); } }
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
10-02-2008 13:57
The Wiki is your friend here: http://lslwiki.net/lslwiki/wakka.php?wakka=llSetSoundQueueing"The queue is one level deep (i.e., only one sound will queue up at a time)." Maybe you could use a shorter timer, and wake up when you know you're in the 2nd sound, and queue up the 3rd sound at that time? And then go back to sleep for the remainder of the 60 seconds?
|
|
Crunch Underwood
Mr. Grown up, Go away sir
Join date: 25 Sep 2007
Posts: 624
|
10-02-2008 14:08
this is just my opinion, but things that make repeatative sounds in SL really drive me nuts, are you sure you need it to go off every minute?
-Crunch
_____________________
---------------------------------------------- So your final Nimbus Score is 8.15, a quite remarkable achievement for a biped. Congratulations Crunch, you should be very proud. 
|
|
Cappy Frantisek
Open Source is the Devil!
Join date: 27 Oct 2006
Posts: 400
|
10-02-2008 14:54
From: Crunch Underwood this is just my opinion, but things that make repeatative sounds in SL really drive me nuts, are you sure you need it to go off every minute?
-Crunch I tend to agree with this but if you are so inclinded you should use: http://wiki.secondlife.com/wiki/LlPreloadSound
|
|
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
|
10-02-2008 16:11
Interesting, I feel Second Life is sorely lacking in ambient sound! From: someone // Just put sounds in object inventory and voila
integer i = -1;
default { state_entry() { llSetTimerEvent(60.0); }
timer() { integer t = llGetInventoryNumber(INVENTORY_SOUND); i++; if(i >= t) i = 0; // Use llTriggerSound because otherwise only people who have the bell on their interest list can hear it if(t) llTriggerSound(llGetInventoryName(INVENTORY_SOUND, i), 1.0); } }
|
|
Oshi Leakey
Registered User
Join date: 21 Jan 2008
Posts: 10
|
10-02-2008 16:32
Well, the design is to have it play every hour, like the belltower on our campus. I put it to 60 seconds to test. Thanks for your help, Ill test it out ASAP and get back to you guys.
Josh
|
|
bobbyb30 Swashbuckler
Registered User
Join date: 8 Sep 2008
Posts: 46
|
10-02-2008 16:56
From: Day Oh Interesting, I feel Second Life is sorely lacking in ambient sound! I must agree with you=D
|
|
bobbyb30 Swashbuckler
Registered User
Join date: 8 Sep 2008
Posts: 46
|
10-02-2008 17:07
From: Oshi Leakey Hey guys! I would like to play a 30 second sound clip every minute (for a belltower). It seems to work, except it doesnt play the third sound, clock_03. The first two play but not the third. If I edit out clock_02, it plays clock_03, so I am stumped. Does SetSoundQueueing only work for 2 stitched audio files? Here is my code: default{ state_entry(){ llSetTimerEvent(60); } timer(){ llSetSoundQueueing(TRUE); llPlaySound("clock_01", 1); llPlaySound("clock_02", 1); llPlaySound("clock_03", 1); } } Here is some code... // www.lsleditor.org by Alphons van der Heijden (SL: Alphons Jano) //Written by Bobbyb30 Zohari (C) 2009 //Created  ctober 2, 2008 //Distributable under the Creative Commons Atrribution license //http://creativecommons.org/licenses/by/3.0/ string sound1;//instead of using the sound name, use UUID string sound2; string sound3; //no editing below integer counter; default { state_entry() { llSetTimerEvent(9.5); llSetSoundQueueing(TRUE); } timer() { ++counter; if(counter == 0) { llPlaySound(sound1); llSetTimerEvent(9.5); } else if(counter == 1) llPlaySound(sound2); else { llPlaySound(sound3); llSetTimerEvent(29.5); counter = 0; } } }
|
|
Crunch Underwood
Mr. Grown up, Go away sir
Join date: 25 Sep 2007
Posts: 624
|
10-02-2008 17:25
From: Day Oh Interesting, I feel Second Life is sorely lacking in ambient sound! agreed, just repeatative sounds drive me batty, espeically if your near them for a length of time. when there mixed tho, such as several different bird calls, creaking wood, wind blowing, ect. can be quite nice  sorry to go off topic -Crunch
_____________________
---------------------------------------------- So your final Nimbus Score is 8.15, a quite remarkable achievement for a biped. Congratulations Crunch, you should be very proud. 
|