# Swapping between audio files if a countdown finishes

**URL:** <https://qa.fmod.com/t/swapping-between-audio-files-if-a-countdown-finishes/19993>\
**Category:** FMOD Studio\
**Created:** [March 20, 2023, 2:20pm UTC](https://qa.fmod.com/t/swapping-between-audio-files-if-a-countdown-finishes/19993 "2023-03-20T14:20:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DiamondBayonet](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@DiamondBayonet](https://qa.fmod.com/u/DiamondBayonet)\
**Post date:** [March 20, 2023, 2:20pm UTC](https://qa.fmod.com/t/swapping-between-audio-files-if-a-countdown-finishes/19993/1 "2023-03-20T14:20:58Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [March 21, 2023, 3:15am UTC](https://qa.fmod.com/t/swapping-between-audio-files-if-a-countdown-finishes/19993/2 "2023-03-21T03:15:29Z")

</div>

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.
