We’re trying to implement audio events for weapons in our game. Currently, we want to start an event when player starts shooting (and presses down a mouse button), and stop it once the player releases the mouse button. Audio is looped with a loop region, size of which is configured to match rate of fire of a weapon, and it seems to work fine when rate of fire is static.
However, there are certain mechanics in our game which can influence weapon’s rate of fire, for example, increase it by 5%, or something like that. Our problem is, we cannot control the duration of the loop region within the event instance. Is there any solution in our case? Could weapons with variable rate of fire be implemented any other way? Maybe I have just overlooked some way to attach parameters to loop regions?
We’ve already tried to start each shot sound separetely, via core api, but it doesn’t work that well due to minor but noticable jittering of the rate of sounds (possibly caused by synchronization timings between game thread and fmod thread), we wanted to use fmod event to achieve beat-perfect (or at least close to that) rate of audio playback.
Below I am attaching an example of our current setup of the event for rapid weapon shooting. Single shots are implemented with a separate event.