Xxaxx Constantine Posted November 18, 2013 Share Posted November 18, 2013 Can someone please give me a clue on when one should use llPlaySound versus llTriggerSound?I suppose the issue comes down to not really understanding the difference between an attached sound and unattached sound.Would this mean the sound follows the object -- if the object is moving.But will that matter if the object doesn't move? Link to comment Share on other sites More sharing options...
PeterCanessa Oh Posted November 18, 2013 Share Posted November 18, 2013 Exactly, and yes - if the object isn't moving and isn't a HUD there's no practical difference between the two functions. ETA: Doh! Rather important typo *blush* Link to comment Share on other sites More sharing options...
Rolig Loon Posted November 18, 2013 Share Posted November 18, 2013 Nope. Not a bit. Suppose you make a train. You have a horn in the train that should play as it approaches a crossing, so you use llPlaySound. That way, the horn's sound travels with the moving train, as you'd expect it to in the real world. Suppose that you also have a crossing signal that should ring a bell when the train approaches. You could put the bell sound and the actuating script in the crossing signal, which is what I would normally do. You could put the script in the train instead, though. If so, you'd want to use llTriggerSound when the train reaches a specific location. That way, the bell sound will start at that spot and will still be playing there as the train moves ahead. And yes, if the train isn't moving at all when the script actuates a sound, it won't matter which function you use. Link to comment Share on other sites More sharing options...
Xxaxx Constantine Posted November 18, 2013 Author Share Posted November 18, 2013 Thank you both for the answers. Follow up question though. I am wondering based on your answers if there are special considerations when using sound from a hud. Link to comment Share on other sites More sharing options...
Rolig Loon Posted November 18, 2013 Share Posted November 18, 2013 I can't think of any. Link to comment Share on other sites More sharing options...
PeterCanessa Oh Posted November 18, 2013 Share Posted November 18, 2013 The rather obvious one is that only the person wearing the HUD will hear it if is an attached sound. If you want anyone else to hear it you HAVE to use an unattached one. Together this means that it is not possible for a HUD to publicly play sounds as the wearer moves around. Link to comment Share on other sites More sharing options...
Xxaxx Constantine Posted November 19, 2013 Author Share Posted November 19, 2013 Very helpful information. Much appreciated. Link to comment Share on other sites More sharing options...
Fenix Eldritch Posted November 19, 2013 Share Posted November 19, 2013 I believe it's also worth mentioning that llPlaySound only supports one sound at a time. So if your script makes a second llPlaySound call before the first one finished playing, it will cut off the first as it starts the second. Unnatached sounds will not experience this can can be layered. Including llSetSoundQueueing(TRUE) would cause llPlaySound calls to let the previous one finish before starting the next. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now