Swapping between audio files if a countdown finishes

HI, I am working on a project which involves a locked door handle having two different states. the first is a state where the player shakes it for a short amount of time for the first 2 tries. After the player shakes it for longer.

That part is fairly straight forward however I would like to add an element in which, if the player doesn’t interact with the door handle for 5 or more seconds, it returns to the first state. I cant figure out how to create this in FMOD though. Can anyone provide any ideas?

While it is possible to create this behavior in FMOD Studio, I strongly suspect you would be better off implementing it in your game’s code, as the “the player hasn’t interacted with this element in a while” timer sounds like it might be important to your game’s state for reasons unrelated to sound design, e.g.: any handle-rattling animations your game might have.

That being said, if you do want to implement this behavior in FMOD Studio, the simplest way would be to create a game parameter with range 0-5 and a velocity of 1, and use a “set parameter” command instrument to set the parameter’s value to 0 whenever the player triggers the “rattle door handle” event. You could then use this parameter as a trigger condition for your long rattle instrument.