# Latency when playing bigger audio files

**URL:** <https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525>\
**Category:** Unreal Engine\
**Created:** [March 6, 2020, 8:58am UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525 "2020-03-06T08:58:09Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bubbleDragon](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bubbleDragon](https://qa.fmod.com/u/bubbleDragon)\
**Post date:** [March 6, 2020, 8:58am UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/1 "2020-03-06T08:58:09Z")

</div>

We recently startet using fmod for a shooter projekt and are currently trying to implement gunshots into the game. I used audio files that consist of a bundle of 20 shots at once to prevent spawning of too many individual events, but i noticed a delay of over 200ms when shooting the gun. I tried out smaller files that only consist of one gunshot and the delay was gone, so i figured there was a buffering problem with my sound files in unreal. I already looked up some posts in the fmod forum and found a way of preloading the events or even the whole bank, but sadly that had no effect on the delay. Am i missing something? Or is the problem not even related to buffering?

Thanks in advance  
Florian

PS: these were the nodes in Blueprint i tried to buffer the samples.  
 ![grafik](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/4eadcd1f0e410154ef2198bc69621c52f7ec1a80.png)

---

<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:** [March 17, 2020, 5:07am UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/2 "2020-03-17T05:07:27Z")

</div>

How are you playing the event?  
It could have something to do with the event creation.

You could also try attaching the Studio profiler, this can help to show you things like memory and CPU usage. It can also show you the time it takes for events sample data to load.

---

<div class="post-metadata">

**Author:** ![bubbleDragon](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bubbleDragon](https://qa.fmod.com/u/bubbleDragon)\
**Post date:** [March 17, 2020, 4:53pm UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/3 "2020-03-17T16:53:44Z")

</div>

thanks for the reply.  
Im currently using the play audio attached node via blueprints.

I used the profiler to check for cpu usage, but how can it display the time required to load the events?

---

<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:** [March 17, 2020, 10:10pm UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/4 "2020-03-17T22:10:30Z")

</div>

Using the ‘Lifespans’ view, you can see when events are created, started, stopped and waiting for sample data to load.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/4/4ae3dade26c4bfc7cd7b8918278e8150f931002f.png)

---

<div class="post-metadata">

**Author:** ![bubbleDragon](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bubbleDragon](https://qa.fmod.com/u/bubbleDragon)\
**Post date:** [March 18, 2020, 10:09am UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/5 "2020-03-18T10:09:21Z")

</div>

okay so i used the livespans view, and i noticed a difference between when instance 1 is created and when sound actually is played. For the test i used a gunshot loop consisting of 20 shots, wich uncompressed is 14,1 MB. I also double checked the audio file itself if it contains some empty space at the beginning, but that was not the case.

 ![grafik](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/a/abc4e712796cc486845d18e272b9c76b5381e3cc.png)

---

<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:** [March 19, 2020, 5:10am UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/6 "2020-03-19T05:10:21Z")

</div>

If you are able to share your profiler capture I will be able to look into it further for you.  
[https://fmod.com/resources/documentation-studio?version=2.0&page=profiling.html#managing-sessions](https://fmod.com/resources/documentation-studio?version=2.0&page=profiling.html#managing-sessions)  
You can upload it to: [https://fmod.com/profile#uploads](https://fmod.com/profile#uploads)  
Including as much data in the package as possible would be best.

---

<div class="post-metadata">

**Author:** ![bubbleDragon](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bubbleDragon](https://qa.fmod.com/u/bubbleDragon)\
**Post date:** [March 19, 2020, 9:47am UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/7 "2020-03-19T09:47:18Z")

</div>

i managed to pack my profiler capture, but unfortunately i cant find a way in my profile to upload the package. When i click the provided link it just redirects me to my profile user details, where i already filled out all mandatory information.

 ![grafik](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/c/c4bf803f513156039d4a1f14cca14dad10b113d5.png)  
this is what i get when i click the link, am i missing something?

---

<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:** [March 19, 2020, 10:22pm UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/8 "2020-03-19T22:22:34Z")

</div>

Can you try again now?

---

<div class="post-metadata">

**Author:** ![bubbleDragon](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bubbleDragon](https://qa.fmod.com/u/bubbleDragon)\
**Post date:** [March 20, 2020, 3:01pm UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/9 "2020-03-20T15:01:10Z")

</div>

yes now it worked. the package consists of three single gunshot sounds for comparision, folloed up by the 20 shot samples with the discussed latency.

---

<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:** [March 23, 2020, 2:20am UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/10 "2020-03-23T02:20:38Z")

</div>

Thanks for that, it looks like the asset/s for gunshot loop are being streamed which will cause a delay as it needs to read from file as it plays it.

---

<div class="post-metadata">

**Author:** ![bubbleDragon](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bubbleDragon](https://qa.fmod.com/u/bubbleDragon)\
**Post date:** [March 23, 2020, 12:32pm UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/11 "2020-03-23T12:32:59Z")

</div>

Is there a possibilty to avoid streaming the assets and preload them?

---

<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:** [March 23, 2020, 9:34pm UTC](https://qa.fmod.com/t/latency-when-playing-bigger-audio-files/15525/12 "2020-03-23T21:34:54Z")

</div>

You can’t override the streaming from the game, you have to configure this in the [assets loading mode](https://fmod.com/resources/documentation-studio?version=2.0&page=managing-assets.html#loading-modes) in the Studio project.
