• Synchronized sound/music playback from multiple prims
I've found this script from Huns Valen in the Library.
I would adapt the script below instead of the Player script, The Sound of Music, written by Sausage Turner.
CODE
string card;
integer line;
key query;
integer part=0;
integer channel=55000;
integer handle;
integer v;
integer w;
list soundlist = [];
list soundnames = [];
list b;
menu(key id)
{
if ( v < 13 )
{
b = soundnames;
}
else
{
if (part == 0)
b = llList2List(soundnames, 0, 1) + [">>"] + llList2List(soundnames, 2, 10);
else if (part == w)
b = llList2List(soundnames, part * 10 + 1, part * 10 + 2) + ["<<"] + llList2List(soundnames, part * 10 + 2, part * 10 + 10);
else if ( 0 < part < w)
b = llList2List(soundnames, part * 10 + 1, part * 10 + 1) + ["<<"] + [">>"] + llList2List(soundnames, part * 10 + 2, part * 10 + 10);
}
llDialog(id, "Choisissez un son:", b, 55000);
}
default
{
on_rez(integer start_param)
{
llSetText("Preloading....",<1,0,0>,1);
llPreloadSound(card);
llSetText("Touch To Play",<1,1,1>,1);
}
state_entry()
{
if (llGetInventoryNumber(INVENTORY_NOTECARD) == 0)
{
llOwnerSay("Aucune notecard n'a été détectée dans l'inventaire de l'objet.");
}
else
{
card = llGetInventoryName(INVENTORY_NOTECARD, 0);
query = llGetNotecardLine(card, line = 0);
}
}
changed(integer c)
{
if (c & CHANGED_INVENTORY) llResetScript();
}
dataserver(key id, string data)
{
if (query != id) return;
if (data == EOF) return;
integer i = llSubStringIndex(data, "=");
if (i >= 0) {
soundnames += [llGetSubString(data, 0, i - 1)];
soundlist += [llDeleteSubString(data, 0, i)];
}
query = llGetNotecardLine(card, ++line);
}
touch_start(integer total_number)
{
key id = llDetectedKey(0);
llListenRemove(handle);
handle = llListen(55000, "", id, "");
v = llGetListLength(soundnames);
w = llFloor( (v-3) / 10);
menu(id);
llSetTimerEvent(30.0);
}
timer()
{
llListenRemove(handle);
llSetTimerEvent(0.0);
}
listen(integer channel, string name, key id, string message)
{
if (message == ">>")
{
part += 1;
llSetTimerEvent(30.0);
menu(id);
return;
}
if (message == "<<")
{
part -= 1;
llSetTimerEvent(30.0);
menu(id);
return;
}
integer index = llListFindList(soundnames, [message]);
if (index < 0) return;
llPlaySound(llList2String(soundlist,index),1.0);
llListenRemove(handle);
llSetTimerEvent(0.0);
}
}
How to adapt the script with the slave speakers?
Thank for your help.
