# FMOD EventInstance doesn't respect cooldown

**URL:** <https://qa.fmod.com/t/fmod-eventinstance-doesnt-respect-cooldown/14567>\
**Category:** FMOD Studio\
**Created:** [April 14, 2019, 6:48am UTC](https://qa.fmod.com/t/fmod-eventinstance-doesnt-respect-cooldown/14567 "2019-04-14T06:48:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitofu](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bitofu](https://qa.fmod.com/u/bitofu)\
**Post date:** [April 14, 2019, 6:48am UTC](https://qa.fmod.com/t/fmod-eventinstance-doesnt-respect-cooldown/14567/1 "2019-04-14T06:48:08Z")

</div>

Using FMOD 1.10.12 in Unity

`FMOD.Studio.EventInstance` doesn’t seem to be respecting cooldown set in the macro controls.

I am calling `FMOD.Studio.EventInstance::start` roughly every frame, after initializing it in a start method and the audio is just overlapping and blowing up.

Edit: If it’s not suppose to, is there a way to make it? I need many instances of various audio, but would rather not use 1 emitter per audio file.

I have tested this with both `FMODUnity.StudioEventEmitter::Play` with an emitter and, `FMODUnity.RuntimeManager::PlayOneShot`  
and they both seem to be properly waiting for cooldown.

I’m not sure if I’m missing something, and advice would be greatly appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [April 18, 2019, 5:46am UTC](https://qa.fmod.com/t/fmod-eventinstance-doesnt-respect-cooldown/14567/2 "2019-04-18T05:46:12Z")

</div>

Calling start on Event Instance will restart that instance it if it is already playing:

> If the instance was already playing then calling this function will restart the event.

[https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-eventinstance.html#studio\_eventinstance\_start](https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-eventinstance.html#studio_eventinstance_start)

When we restart an Event Instance, the first thing we do is stop the current playing instance, then we figure out if we should start another one in this case no because the cooldown has not elapsed).

Using `StudioEventEmitter::Play` and `RuntimeManager::PlayOneShot` will work because they create new event instances rather than reusing the old one. In this case the old Event won’t get stopped and the new one/s won’t actually start until the cooldown time has passed.

---

<div class="post-metadata">

**Author:** ![bitofu](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bitofu](https://qa.fmod.com/u/bitofu)\
**Post date:** [April 18, 2019, 10:39am UTC](https://qa.fmod.com/t/fmod-eventinstance-doesnt-respect-cooldown/14567/3 "2019-04-18T10:39:36Z")

</div>

That’s unfortunate, I was hoping I could manage most of the reoccuring audio in 1 script with event instances.

Correct me if I’m wrong but, `StudioEventEmitter` requires attaching the script to the unity game object right? Also `PlayOneShot` don’t have parameters right, or do global parameters in 2.00 have an effect now?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [April 24, 2019, 2:04am UTC](https://qa.fmod.com/t/fmod-eventinstance-doesnt-respect-cooldown/14567/4 "2019-04-24T02:04:15Z")

</div>

> [@bitofu](#):
>
> `StudioEventEmitter` requires attaching the script to the unity game object right?

The StudioEventEmitter inherits from MonoBehaviour and all MonoBehaviours must be attached to GameObjects to run.

> [@bitofu](#):
>
> `PlayOneShot` don’t have parameters right

Correct, `PlayOneShot` does not allow you to set parameters on the Event. Although you can see in the RuntimeManager.cs that all the `PlayOneShot` function does is:

- Create Instance
- Set 3D attributes
- Start Instance
- Release Instance

You could make your own for your specific needs.

---

<div class="post-metadata">

**Author:** ![bitofu](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bitofu](https://qa.fmod.com/u/bitofu)\
**Post date:** [April 24, 2019, 3:52am UTC](https://qa.fmod.com/t/fmod-eventinstance-doesnt-respect-cooldown/14567/5 "2019-04-24T03:52:52Z")

</div>

Good idea, thanks for the answers and your time!
