# Example code for Programmer Instruments doesn't work. "Loading Delay Exceeded"

**URL:** <https://qa.fmod.com/t/example-code-for-programmer-instruments-doesnt-work-loading-delay-exceeded/19025>\
**Category:** Unity\
**Created:** [July 19, 2022, 1:33pm UTC](https://qa.fmod.com/t/example-code-for-programmer-instruments-doesnt-work-loading-delay-exceeded/19025 "2022-07-19T13:33:55Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [July 24, 2022, 11:30pm UTC](https://qa.fmod.com/t/example-code-for-programmer-instruments-doesnt-work-loading-delay-exceeded/19025/5 "2022-07-24T23:30:26Z")

</div>

Hi,

The `Loading delay exceeded, sound may play at incorrect time` error means that too many samples are being loaded in at once, to solve this we need to change which `FMOD.MODE` we use when creating the sound. The line we will need to change is:

```auto
FMOD.MODE soundMode = FMOD.MODE.LOOP_NORMAL | FMOD.MODE.CREATECOMPRESSEDSAMPLE | FMOD.MODE.NONBLOCKING;

//Too 

FMOD.MODE soundMode = FMOD.MODE.CREATESTREAM;

```

In the `CALLBACK` function. This mode is explained under [FMOD API Reference | Common | FMOD\_MODE.](https://www.fmod.com/docs/2.00/api/core-api-common.html#fmod_mode)

`Waveform instance in error state 38` is due to an invalid seek position being passed into the `createSound()` function. Unfortunately, I was not able to recreate this error when loading in a mod file. However, a solution may be using `StudioSystem.setStreamBufferSize()` to increase read head, as explained under [Core API Reference | System.](https://fmod.com/docs/2.02/api/core-api-system.html#system_setstreambuffersize)

We are always looking to improve our documentation and I have passed on your comments to our dev team.

---

_[View the full topic](https://qa.fmod.com/t/example-code-for-programmer-instruments-doesnt-work-loading-delay-exceeded/19025)._
