So, to provide some context: I bump into this problem when invoking singular instances of two different events (so, just two Event Instances in total). Neither of these events have stealing, or limited instance counts (same goes for all of my busses).
[1st - Music track]
The first event is a 2D 8 second loop that plays continuously. It is comprised of 98 Audio Tracks (.ogg files in each) and 26 parameters, some of which control the volumes of some tracks, while others control various effects. It is an extremely demanding event, to put it mildly. On top of that, it is set to Highest Priority (I’ve set it up this way so that the different tracks inside this event wouldn’t get virtualized and become out of sync – I am aware of how impractical this is, and would definitely appreciate any tips or alternative ways on how to deal with track synching in this situation).
[2nd - Swing SFX]
As for the second event - it is a 3D, Medium Priority, Multi Instrument Action. It has some effects with random modulation, but all in all, it’s a pretty straightforward one-shot event.
Naturally, if any more different instances are played in the build, none of them are audible, since the main music track is using up all the 32 real voice channels due to it being set to the Highest Priority.
I’m using custom code to invoke both of the events by simply using the following methods:
Instance = RuntimeManager.CreateInstance(Reference);
RuntimeManager.AttachInstanceToGameObject(Instance, _origin);
(this is only for the 2nd event which has a spatializer component)
Instance.start();
I’m also listening to EVENT_CALLBACK_TYPE.STOPPED
callbacks and once I receive them, I call the methods Instance.setUserData(IntPtr.Zero)
; and Instance.release()
; to clean up the instances that have stopped playing.
Here’s some screenshots from a longer profiler sessions, in which you can see that the total voices count doesn’t increase over time. You’ll also note some random spikes - I’m still not sure what causes them exactly (there’s an audible pop at the end of the loop, which is not there when playing in the editor).
[Build profiling session]
[Editor profiling session]
And here’s a screenshot of my projects Mixing window, just in case.
If there’s anything else I can provide from my end, just let me know.
Thanks!