
09-Jul-2012 19:33
The only priority I've seen for sound has been this one flag in the PlaySound cog verbs.
JK has a maximum of up to 24 channels, which is set in the Setup -> Sound. If you were to play more than 24 sounds (or what is set in the Setup), the first ones would be cut if not looped. If all are looped, the last ones won't play.
You would have to either be stingy with your sounds, optimize to play sounds only if they are in earshot, or set the loop flag on the first part of the tune and after the timer (sleep, whatever) stop the first loop before the main loop.
Here's a nice line of code:
if( VectorDist( GetThingPos( soundEmitter ), GetThingPos( GetPrimaryFocus( GetCurrentCamera() ) ) ) < soundMaxDistance / 10 )
|
if the distance between the soundEmitter and the current camera is less than the max distance that the sound can be heard (and converted to JKUnits)...
Hope this helps.
/Edward