# Latency on parameter change in certain events

**URL:** <https://qa.fmod.com/t/latency-on-parameter-change-in-certain-events/17374>\
**Category:** FMOD Studio\
**Created:** [June 22, 2021, 8:58am UTC](https://qa.fmod.com/t/latency-on-parameter-change-in-certain-events/17374 "2021-06-22T08:58:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeben](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sandeben](https://qa.fmod.com/u/sandeben)\
**Post date:** [June 22, 2021, 8:58am UTC](https://qa.fmod.com/t/latency-on-parameter-change-in-certain-events/17374/1 "2021-06-22T08:58:02Z")

</div>

Similar to some other posts in the last couple years, I’m experiencing latency in some situations when I change parameters. Please check out this video walking through it:

[![](https://img.youtube.com/vi/6R2viaN2CFM/hqdefault.jpg "FMOD latency problem") ](https://www.youtube.com/watch?v=6R2viaN2CFM)

I can’t understand why this much latency is introduced when I work this way, and it seems like it could be a serious problem down the line. For now, I could probably find another to work around this, but if it did work like this, it would be a very nice and smooth way to do things.

I’m using version 2.01.09. None of the relevant sounds are streaming, and all assets are WAVs. I have tried moving the relevant instruments to different places on the timeline as well, played with source/destination regions, and reduced the area shown in the attached image to its minimum (zero) length, with no change.  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/2/21194110e7526487c519a82e5958326046a5655f.png)

Here are the similar posts:

> [@Transitions latency when changing parameter](https://qa.fmod.com/t/transitions-latency-when-changing-parameter/14383):
>
> I’m having an issue where my transition doesn’t happen immidiately when the parameter is changed, as you can see in the screen recording here. in happens around 100-200 ms later, which is quite annoying. This is also the case when using the event in Unity. Link to screen recording: [https://youtu.be/aPhcU53j0s8](https://youtu.be/aPhcU53j0s8) Any idea what’s going on here? Thank you

> [@400ms transition latency when changing parameter](https://qa.fmod.com/t/400ms-transition-latency-when-changing-parameter/16032):
>
> This issue seems very similar to [Transitions latency when changing parameter](https://qa.fmod.com/t/transitions-latency-when-changing-parameter/14383/34), however I’m experiencing nearly 2x latency as that post mentioned, and changing Schedule Latency and Schedule Delay didn’t seem to do anything. The latency is very close to 400ms, usually 380-400ms no matter what I change. I’ve also tried changing the DSPBuffer settings as well, with no difference in latency. I understand that there will always be some latency, but nearly half a second seems excessive! There’s no strea…

Thanks!

---

<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:** [June 25, 2021, 4:27am UTC](https://qa.fmod.com/t/latency-on-parameter-change-in-certain-events/17374/2 "2021-06-25T04:27:52Z")

</div>

I can’t be totally certain without seeing your event in person, but I suspect that the latency may be related to the fact that your multiply nested events make use of parameter trigger conditions.

There are three details that I suspect may be combining to produce the behavior you’ve observed.

- As mentioned in the threads you’ve linked, there is always an unavoidable amount of latency when an event instance’s behavior depends on a parameter, so as to allow our scheduling system to schedule the audio to be played.
- Nested event instances are not created until the event instrument associated with the nested event is triggered. This means that if an event instance starts when a nested event instrument is triggered, that instance does not exist before that instrument is triggered.
- For obvious reasons, a nested event instance’s parameters can only be set once the nested event instance exists.

Each of the nested events in your video has parameter-based behavior, meaning that they contain behavior that will involve a parameter delay. Because there are multiple levels of nested event and each of those levels is subject to latency, you’re hearing each of those event instances’ parameter-based latencies in sequence - and the same latency three times in a row is much more obvious than just once.

---

<div class="post-metadata">

**Author:** ![sandeben](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sandeben](https://qa.fmod.com/u/sandeben)\
**Post date:** [July 1, 2021, 6:27am UTC](https://qa.fmod.com/t/latency-on-parameter-change-in-certain-events/17374/3 "2021-07-01T06:27:39Z")

</div>

Thanks for your reply. That makes sense, and I’ll keep it in mind and try and avoid nesting events too much in the future.

Got a confession to make though – it looks like one of my files had accidentally been marked as streaming (the engine start one-shot, no idea when/how that happened), and as that was referenced in a later event, it caused the whole event to suffer from latency. Removing the event also didn’t remove the latency immediately – only by removing the event, then deselecting and reselecting the whole event was the latency gone, so this threw me off a bit. Still my fault though!

---

<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:** [July 2, 2021, 1:48am UTC](https://qa.fmod.com/t/latency-on-parameter-change-in-certain-events/17374/4 "2021-07-02T01:48:50Z")

</div>

I’m glad to hear you were able to get it working.

> [@sandeben](#):
>
> Removing the event also didn’t remove the latency immediately – only by removing the event, then deselecting and reselecting the whole event was the latency gone, so this threw me off a bit.

This occurs because FMOD Studio loads the assets of an event when the event is selected for display in a tab of the editor pane of the event editor window, and unloads them when the event is deselected and stops being displayed in that tab. This loading behavior is only used to audition events in FMOD Studio, and has no impact on in-game behavior.

I should mention that whenever you import an audio file that’s at least ten seconds long into an FMOD Studio project, FMOD Studio automatically sets it to stream. This is because assets of that length are usually dialog or music, and thus likely to benefit from streaming and unlikely to be played at the same time as each other. If you want to change the length of audio file that’s automatically set to stream, or disable this behavior entirely, you can do so in the “Assets” tab of the preferences window.
