Audio playback will delay 0.5 seconds on Android


#1

Recently I have encountered a problem: the sound effect will be delayed after 0.5 is played on the Android phone. It seems to be very common, but I have not found an effective solution. What does it seem to have to do with OpenAL? I don’t know much about this. Is there any general solution available? :laughing: Thank you!


#2

In my apk package, I did not find the openal.so file.


#3

Version:
Lime:6.4.0
Openfl:8.2.0


#4

@singmajesty I need your help, thank you!


#5

I found that lime updated MojoAL, will it help this, and look forward to the release of 7.0.0.


#6

Can you tell if the delay is decoding the audio file, or is it playback? Is there a delay every time the sound is played, or only the first?


#7

Every time this will happen, I am currently testing 3 Android devices, this problem will occur. I also tried to use Demo to get the same result.


#8

Forgot to explain, my music resources are cached locally.


#9

If there is a delay only the first time, then it might be decoding the sound file into memory, but if you have already loaded the sound, and pause, play the same sound, then the delay would be caused by the audio library (like ALsoft) rather than the decoding.


#10

I think this is probably the problem. Is there any good way to solve this? This sound sounds uncomfortable on Android.


#11

I now have a temporary solution, using Android’s native SoundPool API, I rewrote two classes: Sound&SoundChannel to bind this SoundPool API, which does not prevent me from generating HTML5 or C++ other platforms. This makes my delayed sound disappear. :laughing: