Hey Guys,
i don´t know why but when i start my game, EVERY Sound Effect, when it plays for the FIRST time, it plays with a delay of a few Mili Seconds. For example my Players Jump Sound: First Time Jumping = Delay. After that there is no longer a delay.
I’m experiencing the same issue, I believe it’s due to the engine loading the sound into memory the first time, and then playing that straight off subsequentially.
So I’d like to make all the needed sound effects preloaded, I tried using prime on load, but to no avail.
I haven’t measured it, but it’s significant enough to easily tell just by ear.
Having this issue as well. Moved over to UE5 from 4.27, and triggering sounds inside of UMG has a roughly 1 second delay, which is quite long for short beep sounds that should load instantly. Not using any MetaSounds yet, just regular playing of a sound.
Try experimenting with the other “load behavior override” options. It can also be overridded on individual soundwaves. After further experimentation I found that “load on demand” works better for me, and vastly improves the situation, though it still isn’t perfect.
I have had a little more time to investigate this. Here’s what little I know. In 4.27 there was an experimental feature called “audio stream caching”. I had never enabled it.
In UE5 it seems to be enabled by default, and no longer experimental.
Here’s the documentation:
This feature is what is causing our problems. Unfortunately, I can’t find a way to disable it completely. I thought ‘Prime on Load’ had solved the issue, but during testing of a packaged build, when I move to the second map in my game many of the sounds disappear entirely. Perhaps the cache is getting full? A tiny 8MB seems to be the default. The documentation mentions the command “stat audiostreaming” to actually view the cache statistics, but this command isn’t doing anything for me. I’m guessing they changed the name and forgot to update the documentation perhaps. Very annoying.
So if anyone has any more information on this feature, beyond what the overview states, then please share.
Ultimately I switched to using MetaSounds and now there is NO DELAY on initial play of this asset. Even if I add a random array of soundwaves inside the MetaSound. And even if I dont set the SoundWaves to Prime On Load. So it seems there is something weird with SoundCues
No, you shouldn’t do that. The Metasound really works without lag, but it has very minimalistic functionality, for example there is no loop for N iterations, no such feature as “Crossfade by Distance” and many more, so I’m unable to make a simple rifle burst sound with echo in the end.
The Metasound looks like an unfinished feature prototype with a very interesting idea which should be implemented later, so, we’ll wait.
Regarding sound lag problem - I have it only for sound playing through the Audio Component of my rifle BP. If I use simple montage with looped shots where every single shot is triggered by corresponding Animation Sequence I get correct sounds without lags and with proper fading by distance - this has fixed my problem.