StopEventsOutsideMaxDistance Replaying events from beginning

Hello,

We’re using StopEventsOutsideMaxDistance as we have emitters on some prefabs that are quite numerous like wind rattle on fences (100s of fences in the scene in the distance which will never be heard) so it’s a way of consuming less resources.

However in some events I have looping audio and stopping logic e.g, a spray can which has a shoot impact to start, looping spray and a little impact when stopped to close the spray.

This is just one example of looping audio with stop logic, from previous testing with other events exactly like this it seems going outside max distance and coming back into it causes the event to play from the beginning and therefore hearing things that make no sense like the impact of firing the spray while technically in the middle of the spray, now this is obviously the expected behaviour and it’s not a problem for some looping events like room tone etc but for others like this it is a problem and I just wanted to be clear on my options here.

  1. Turn StopEventsOutsideMaxDistance off and control the amount of emitters which will be active, maybe query emitters outside the walkable areas and turn them off for good. this would mean we can just let the default virtual voice system do the work, to my knowledge virtualised events will continue to play but consume no CPU and therefore will play from the correct position when audible again.. am I correct there? Also I’m aware that virtual voices have a limit too so this would fill those up quite quickly! our scenes can be quite large so lots of emitters would still be loaded into memory when 100s of units away.

  2. Control distance attenuation with the built-in distance parameter manually and Increase these events max distance by a certain amount which would mean by the time it’s audible again it would be inside the loop and we wouldn’t hear the initial impacts etc

  3. Split off any audio that’s related to stopping or cancelling into a separate events and just trigger that via code when we stop the loop… although this is the simplest it would be rather boring work, create more unnecessary events and would be a shame not to use these cool FMOD features like stop logic etc.

Maybe all of these are fine solutions but just thought I’d ask in case I’ve missed any important info or other solutions!

Thanks so much for your time!