First Time Sound Play = Delayed?

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.

Can someone help me out?
Thanks!

10 Likes

Hello

What engine version are you using?

1 Like

Hey,
I´m using UE5.

Thank you!

2 Likes

Ah interesting - how are you measuring the delay out of interest?

I haven’t noticed this myself on UE5. Maybe doe thing to do with buffer or streaming settings, or even a hardware interface issue.

Sorry can’t be more useful!

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.

4 Likes

Very strange, never come across it - is this UE5, and if so, using a Metasound Source?

For anyone struggling with this issue, this is what worked for me: In the soundClass, change ‘Loading Behavior Override’ to ‘Prime On Load’.

I got this issue after I switched my project from 4.27 to UE5.

12 Likes

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.

1 Like

That makes no difference for me. Not using meta yet here either.

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.

Changing loading behavior to “Prime On Load” for the files worked for me, but it required a restart of the IDE to kick in. Thanks for the suggestion!

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.

1 Like

Same situation here, delay, and priming doesn’t help. Just submitted a bug report.

2 Likes

I was going crazy with this bug too.

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

1 Like

It´s still not fixed.

Confirming Bradical’s message: MetaSound is a Solution here - no starting lag anymore.
The Lag was sponsored by MetaSound developers :wink:

To Use it in the C++:

  1. Add “MetasoundEngine” to modules list of PublicDependencyModuleNames.AddRange() in the build.cs
  2. #include “C:/Program Files/Epic Games/UE_5.0/Engine/Plugins/Runtime/Metasound/Source/MetasoundEngine/Public/MetasoundSource.h”
  3. Use UMetaSoundSource instead of USoundCue. For example:
    UPROPERTY(EditDefaultsOnly, BlueprintReadWrite) UMetaSoundSource *MS_Fire_Burst_Sound = 0;
  4. The UAudioComponent can treat MetaSound as well as USoundCue.

And by the way, the MetaSound is providing more powerful way to construct any sound you need much interesting than Sound Cue does.

So I have to replace all the sound cues in question with meta sound?

In my case, this problem appeared since UE4. Changing the SoundClass to PrimeOnLoad fixed the problem.

1 Like

As mentioned by myself and several others, that setting hasn’t made any difference for us.

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.