|
Danielz Shackle
Registered User
Join date: 30 Apr 2006
Posts: 100
|
05-16-2006 01:53
quick question,
reading through wiki, appears i f i have an object pre-load sounds it keeps sounds from lagging during usage, but causes lag at the beginning. Is this correct? and which way is better, to pre-load or just let them play.
also, i think im missing something simple in audio script, whats the correct way to write it?
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
05-16-2006 02:21
From: Danielz Shackle quick question,
reading through wiki, appears i f i have an object pre-load sounds it keeps sounds from lagging during usage, but causes lag at the beginning. Is this correct? More or less yes. Preloading doesn't always work, but usually does, and makes sure that the clients around have the sounds loaded so when they're told to play them off it goes without downloading the sound to the client first. The sounds therefore play quickly, but may take a while to load. From: someone and which way is better, to pre-load or just let them play. There isn't a definitive answer to that - it depends on what you're doing. Looped ambient sound, possibly any ambient sound works pretty well without preloading and any looped sound too - because people will arrive in the middle of the sound's cycling as you might expect and the sound won't get preloaded. For something like an instrument (hyperflute being one) forcing a preload is worth it because it's going to play any of the 30 or so notes in an essentially unpredictable fashion to everyone... From: someone also, i think im missing something simple in audio script, whats the correct way to write it? What do you want it to do?! There are lots of variations on "an audio script" depending on what precisely you want it to do.
|
|
Danielz Shackle
Registered User
Join date: 30 Apr 2006
Posts: 100
|
05-16-2006 02:27
i just want to play it. i can get all the hard scripts to work but missing something easy i guess on audio
i know you can use an id for sound, but it said if object is in prim you do not need id #, but i cant find an example of setting it as global variable (all i see use key)
i have string beep; (im sure needs an = something)
and later in script
llPlaySound(beep, 1.0)
|
|
Danielz Shackle
Registered User
Join date: 30 Apr 2006
Posts: 100
|
should i just use key?
05-16-2006 02:59
i dont mind using a key for it i guess, i know how to use a keyid file
so if i cant do it like the one above, how doi do i find the keyID of my audio file? i know how to play it, but how do i find the id?
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
05-16-2006 09:17
OK....
string beep; ... llPlaySound(beep, 1.0);
won't work as you've noticed. There's a number of ways around that...
if the sound is in the object's inventory you set beep to be the sound's precise name.
e.g string beep="beep sound";
OR
You can get the key (if the sound is full perms) by opening your inventory, finding the sound file in it and choosing "Copy Asset UUID" from the right click menu. You'll get a string of letters and numbers, paste them in e.g.
string beep="12345678-90ab-cdef-0123"; (it will actually be 36 characters long)
|