Delay/latency when playing sounds

Hey,

If I play an event (via UFMODBlueprintStatics::PlayEventAtLocation as described in 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/precise-music-playback-time/

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

Thanks!

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.

1 Like

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?

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.