# delay playing event instances

**URL:** <https://qa.fmod.com/t/delay-playing-event-instances/12321>\
**Category:** FMOD Studio\
**Created:** [February 19, 2016, 3:47pm UTC](https://qa.fmod.com/t/delay-playing-event-instances/12321 "2016-02-19T15:47:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmayer1](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@gmayer1](https://qa.fmod.com/u/gmayer1)\
**Post date:** [February 19, 2016, 3:47pm UTC](https://qa.fmod.com/t/delay-playing-event-instances/12321/1 "2016-02-19T15:47:18Z")

</div>

I’m getting delays playing simple event instances, on both win32 and iOS. I thought I had all the basics down:

Studio vs. 1.07.05  
code: #define FMOD\_VERSION 0x00010705

- all events are set NOT streaming in Studio
- building Vorbis on Desktop, FADPCM on iOS
- I loadSampleData on the entire single master bank at load time (and it completes successfully)
- I create all EventDescriptions once at load time also.
- I create each instance on-the-fly and play (but I assumed this would work with no perceivable delay, as the whole bank is loaded)
- yet I am hearing delays before playback, ranging from very slight to huge (approx 1 second!)
- the delay is the same on both win32 and iOS.

Any thoughts as to what I’m doing wrong?

Many thanks in advance.  
Greg

---

<div class="post-metadata">

**Author:** ![graeme](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@graeme](https://qa.fmod.com/u/graeme)\
**Post date:** [February 23, 2016, 8:05am UTC](https://qa.fmod.com/t/delay-playing-event-instances/12321/2 "2016-02-23T08:05:45Z")

</div>

> [@](#):
>
> I’m getting delays playing simple event instances, on both win32 and iOS. I thought I had all the basics down:
> 
> Studio vs. 1.07.05  
> code: #define FMOD\_VERSION 0x00010705
> 
> - all events are set NOT streaming in Studio
> - building Vorbis on Desktop, FADPCM on iOS
> - I loadSampleData on the entire single master bank at load time (and it completes successfully)
> - I create all EventDescriptions once at load time also.
> - I create each instance on-the-fly and play (but I assumed this would work with no perceivable delay, as the whole bank is loaded)
> - yet I am hearing delays before playback, ranging from very slight to huge (approx 1 second!)
> - the delay is the same on both win32 and iOS.
> 
> Any thoughts as to what I’m doing wrong?
> 
> Many thanks in advance.  
> Greg

Does the delay occur every time you play an instance, or just the first time?

---

<div class="post-metadata">

**Author:** ![gmayer1](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@gmayer1](https://qa.fmod.com/u/gmayer1)\
**Post date:** [February 24, 2016, 12:44am UTC](https://qa.fmod.com/t/delay-playing-event-instances/12321/3 "2016-02-24T00:44:50Z")

</div>

I figured out the problem - there is only one event that had significant delay, and it was because the place where System update was getting called was actually blocked from being called for a short time, while several systems in the engine were paused.  
[facepalm]  
Then, because of the one “real” delay, I wasn’t sure if the others were playing on time, but I think they’re fine.

thx  
Greg

---

<div class="post-metadata">

**Author:** ![graeme](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@graeme](https://qa.fmod.com/u/graeme)\
**Post date:** [February 24, 2016, 2:35am UTC](https://qa.fmod.com/t/delay-playing-event-instances/12321/4 "2016-02-24T02:35:42Z")

</div>

> [@](#):
>
> I figured out the problem - there is only one event that had significant delay, and it was because the place where System update was getting called was actually blocked from being called for a short time, while several systems in the engine were paused.  
> [facepalm]  
> Then, because of the one “real” delay, I wasn’t sure if the others were playing on time, but I think they’re fine.
> 
> thx  
> Greg

I’m just glad to hear it’s all sorted out. It does raise a good point though. In the Studio API, commands are queued until the next system update. So it’s important to call Studio::System::update() regularly.

---

<div class="post-metadata">

**Author:** ![gmayer1](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@gmayer1](https://qa.fmod.com/u/gmayer1)\
**Post date:** [February 24, 2016, 2:39am UTC](https://qa.fmod.com/t/delay-playing-event-instances/12321/5 "2016-02-24T02:39:40Z")

</div>

Thanks Graeme. Can you confirm that it’s “ok” to be creating the instances on the fly, as I am, as long as the banks are fully loaded, and the event descriptions have already been fetched?

---

<div class="post-metadata">

**Author:** ![graeme](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@graeme](https://qa.fmod.com/u/graeme)\
**Post date:** [February 24, 2016, 2:46am UTC](https://qa.fmod.com/t/delay-playing-event-instances/12321/6 "2016-02-24T02:46:49Z")

</div>

Yes, it’s perfectly fine to create event instances on demand. In fact, that’s what we recommend. As long as the sound data is already loaded, there should be no extra delay.

---

<div class="post-metadata">

**Author:** ![gmayer1](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@gmayer1](https://qa.fmod.com/u/gmayer1)\
**Post date:** [February 26, 2016, 3:06pm UTC](https://qa.fmod.com/t/delay-playing-event-instances/12321/7 "2016-02-26T15:06:58Z")

</div>

Excellent, thanks!
