# Delay/latency when playing sounds

**URL:** https://qa.fmod.com/t/delay-latency-when-playing-sounds/12707
**Category:** Unreal Engine
**Created:** [September 21, 2016, 3:10pm UTC](https://qa.fmod.com/t/delay-latency-when-playing-sounds/12707 "2016-09-21T15:10:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anteevy](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@anteevy](https://qa.fmod.com/u/anteevy)
#### Post date: [September 21, 2016, 3:10pm UTC](https://qa.fmod.com/t/delay-latency-when-playing-sounds/12707/1 "2016-09-21T15:10:59Z")

</div>

Hey,

If I play an event (via UFMODBlueprintStatics::PlayEventAtLocation as described in [http://www.fmod.org/documentation/#content/generated/engine\_ue4/programming.html](http://www.fmod.org/documentation/#content/generated/engine_ue4/programming.html) ), it only plays after a short delay (maybe about 100ms?). When triggering the same sound via UE4 (PlaySoundAtLocation) at the same time, the UE4 one is played noticeably earlier with no delay.  
It’s only a minor delay but feels very off if I e.g. use FMOD to play a shot sound on LMB click.

I found two other posts with a similar problem, but no real solution:  
[http://www.fmod.org/questions/question/latency/](http://www.fmod.org/questions/question/latency/)  
[http://www.fmod.org/questions/question/precise-music-playback-time/](http://www.fmod.org/questions/question/precise-music-playback-time/)

I’m on 1.08 with UE 4.13. Are there any ways to reduce the latency?

Thanks!

---

<div class="post-metadata">

### Author: ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)
#### Post date: [September 22, 2016, 5:02am UTC](https://qa.fmod.com/t/delay-latency-when-playing-sounds/12707/2 "2016-09-22T05:02:04Z")

</div>

The primary method for controlling latency in FMOD is via setting the DSP buffer size and number of buffers. This is exposed in the FMOD plugin for UE4 as two properties DSPBufferLength and DSPBufferCount. Try setting them as 512 and 4 respectively.

---

<div class="post-metadata">

### Author: ![anteevy](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@anteevy](https://qa.fmod.com/u/anteevy)
#### Post date: [September 25, 2016, 3:54pm UTC](https://qa.fmod.com/t/delay-latency-when-playing-sounds/12707/3 "2016-09-25T15:54:37Z")

</div>

> [@](#):
>
> The primary method for controlling latency in FMOD is via setting the DSP buffer size and number of buffers. This is exposed in the FMOD plugin for UE4 as two properties DSPBufferLength and DSPBufferCount. Try setting them as 512 and 4 respectively.

Thanks, that worked! The latency is now nearly inaudible. I figure this is the best/recommended setting, or is there still room for adjustments at the cost of performance or whatever?

---

<div class="post-metadata">

### Author: ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)
#### Post date: [September 26, 2016, 5:52am UTC](https://qa.fmod.com/t/delay-latency-when-playing-sounds/12707/4 "2016-09-26T05:52:09Z")

</div>

On most platforms the best practice is leave the default, i.e. don’t call setDSPBufferSize. Windows has a long history of poor drivers which cause problems so the default is higher than usual. That said, 512 x 4 for Windows should be okay for general use but keep an eye (ear) out for stuttering. If latency is absolutely critical (i.e. singing game) consider 512 x 2 and test extensively on all target hardware.
