Hey Kevin,
I’m unsure of any old or new audio engines, so here’s how the audio is setup, what works fine, and what causes delays.
Setup
- It’s the installed binary of UE4 off the launcher, nothing custom to the audio system or engine in any way.
- I drag any .wav file into unreal.
- Create a cube actor with an audio component, add the wav to the audio component
Wav/Cue is already on component when game starts
- If it’s a wav, it will work fine.
- If it’s a sound cue with 2 songs playing at the same time, they both play fine.
X - If it’s a sound cue with 2 songs playing but one has a delay node, that one do the delay node and then have it’s additional delay.
X - If it’s a sound cue using the concatenator node, the second song will be delayed.
X - Song is already on component but not playing. Song is played at a later time, delayed.
Song is set into component during runtime through a USoundBase* reference on the blueprint/class (Component->Setsound(startSong))
- If it’s done during BeginPlay, it works.
X - If it’s done at any point after, it’ll be delayed.
X - Same with sound cues, play immediately = works, not immediately = delayed.
It seems music only works properly during the beginplay phase, any any song that is played at runtime, whether it be dynamically through code or just delayed in the beginplay sound cue, will have it’s loading delays.
This also includes songs that are set to the component in beginplay but not actually played until later. Looks like only the reference is stored and they still need to be loaded the moment they are played.
Note: Setting a songs volume to 0% and then higher does not delay the song, even though it starts it from the beginning, possibly because it’s already loaded.
If this is either the old or new audio system, let me know and I’d love to try the other one.
Thanks!