Saw this issue mentioned in UE-69726
Seems like there’s some memory optimization going on that’s causing issues with this function…
The answer was posted in a forum thread here: https://answers.unrealengine.com/questions/870595/onaudioplaybackpercent-only-returning-zero.html
(check S-ed’s post)
You can add this to your defaultengine.ini file:
[/Script/Engine.SoundGroups]
+SoundGroupProfiles=(SoundGroup=SOUNDGROUP_Default, bAlwaysDecompressOnLoad=false, DecompressedDuration=15)
The “DecompressedDuration” is the key, if that number is higher than the length of your audio file in seconds, then the whole audio file will be stored in memory rather than decompressed in realtime.
That’s what breaks the OnAudioPercentPlayback() function, it needs native access to the entire sound file it seems to be able to work.
I’ve had further issues since this detailed in issue UE-44605, where it’s now just reporting incorrect times.
However, having it report anything at all seems like a step forward.
It took me ages to find this information, so posting in the hope that nobody else has to track all of this down the same way I did.
If anyone knows a workaround or fix for this issue of incorrect percentage reporting, I’d love to hear it!