First sorry for my poor English.
I Build a small game and use OnAudioPlaybackPercent Event to get Position of the audio.This Node Works fine on Windows But It Provide wrong percentage on Android.
On Android,the percentage that provided by this Event is Two times as much as Windows’.
And, This percentage will not bigger than 1,so It cause this situation:when the audio play more than half,the percentage will stop increase,so I can not get position of the audio.
Here is My Blueprint:
And I also find if game is on background, the music will paused but the Percentage still increase.so this event is actually useless on Android.
Hope you can check and solve this Problem.
And,except this,how can I get position of an audio?
I just tested this on my end and did not get the issue to reproduce on my end. If you remove the *1000 float and add a small duration of like 1.0 seconds to your print string, it still does not work?
What android device are you testing, and are you using the new Audio engine flag?
OK,To Test this issue,I build a simple scene.
I begin play audio immediately when the Widget is constructed.
On Windows, Time caculated by OnAudioPlaybackPercent is the same of the Time caculated by Event Tick.:
I have Test this on HUAWEI P9 EVA-AL10 ,MI 5 and HUAWEI Honor 8. all the devices have this issue.
About the New Audio engine flag.I just import the sound file,and play it,I have not set anything.This setting should be default.
Maybe the time provided by FActiveAudio::PlaybackTime seems to be a really time of audio,but actually it’s not.You can play your audio ,switch game to background,wait a second and switch it back. Then you will notice that the audio was paused when the game is on background but the PlaybackTime was still increased.
I see. Well Im developing for Gear VR so there is no way of switching the game to background, I think it solves in my case.
But its very very bad of unreal to not do properly (working on every platform) such basic task. I mean I know its not something easy to implement, but unreal should at least be more concerned about this things. Its impossible to make a music game that syncs with sound without this feature.
Yes, I’m now developing a music game and this issue upset me a lot.Finally I choose to use EventTick to caculate time. Now the users work on android have no way to get really time of an audio.I think this issue is very important,hope Epic can Fix it. @AndrewHurley