MetaSounds: Wave Player Looping is off by a small amount?

Hello everyone. I ran into this problem when building a dynamic music system using the new MetaSound system in Unreal Engine 5.0.3. I found out that when you enable the “Loop” option in the Wave Player node, the timing is off by a few samples, making the timing drift more and more off the longer it loops.

Below are two videos where I demonstrate the problem and a few workarounds I have found. I used a 120 BPM 64 bar metronome track as reference, and tried to loop a 1 bar metronome sample with it. You can hear the timing difference increasing as time goes on in the first video. The samples are identical in my DAW, so all timing differences must have come from metasounds.

The second video demonstrates a few ways to workaround this timing issue, which are:

  • Using “On Nearly Finished” to retrigger the Wave Player
  • Setting the loop duration using “BPM to Seconds”
  • Setting the loop duration using “Get Wave Duration” on the same sample
    This implies that the Wave Player doesn’t use “Get Wave Duration” internally to calculate looping duration, which I think is very strange.

Does anyone have insight about this behavior?

Part 1: Where I show the timing offset

Part 2: A few workarounds I’ve found

Hmm, this is very interesting - have you posted this in the Discord? It would give it extra visibility

Yes I have! A member from unreal has seen my question and forwarded this problem to their team. I hope this gets fixed soon.

I have also recreated the same timing difference in my DAW, by manually delaying and summing the metronome samples, then comparing the summed audio to my recording.

The timing difference creates clear notches in the spectrum that can be used to identify how many extra samples the Wave Player node has created, which turns out to be 1 extra sample per loop.

Imgur

So in my case, when I tried to loop a 96000 sample file, the Wave Player looped every 96001 samples.

1 Like

This bug is fixed in 5.1.

1 Like