Jump to content

llPlaySound or llTriggerSound


Xxaxx Constantine
 Share

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

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

Recommended Posts

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

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

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...