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,
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.
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.
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).
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.
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?
The StudioEventEmitter inherits from MonoBehaviour and all MonoBehaviours must be attached to GameObjects to run.
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.
Good idea, thanks for the answers and your time!