• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android Audio delay Android

ophelius

Member
When I play sounds on Android, there's like a 0.3-0.4 sec delay. I tried different compression types, I would figure the uncompressed not-streamed version would have the lowest latency but there's still a delay. My frame rate is around 260 so it shouldn't be because the game is running too slow. The sound file is properly edited and there's no silence before the audio starts. This delay is not present on Windows. The settings on the sounds are Stereo, 44100 sample rate, 16-bit, 128 bit rate.
Any help would be appreciated in reducing audio latency. Thanks

Edit: After doing more research, this seems to be a problem with Android devices. I'm using Android ver.9, my older phone doesn't support new versions. Does anyone know if this is fixed for future versions?
 
Last edited:

kroart

Member
It’s an Android itself gives you these lags. Different devices shows different lags. Usually old and cheap devises shows higher audio lags.

The only thing you can do within GameMaker as I see is to write android extension and check devise native audio sample rate using AudioManager.getProperty(PROPERTY_OUTPUT_SAMPLE_RATE) as described here: https://developer.android.com/ndk/guides/audio/audio-latency#input-latency

And if your audio have the same sample rate as device’s native sample rate - this can give slightly lower delays. Usually sample rates on devices are 44k and 48k so as an option your game should have two variants of each audio file.

There is another flag that is related to audio latency: PROPERTY_OUTPUT_FRAMES_PER_BUFFER but with GameMaker you can not change audio buffer size.
 

ophelius

Member
Well that's disappointing. Does this also happen on IOS? It's because I'm about to release a game and I don't want to release it on platforms where the audio will be affected this badly, it's a quality control thing. I do have an older Samsung, and I guess it's not the end of the world if the sfx come in a split second late, the rest of the game is smooth. I'll probably still release it but with a notice on Google Play about sound lag.
 

kroart

Member
Well that's disappointing. Does this also happen on IOS? It's because I'm about to release a game and I don't want to release it on platforms where the audio will be affected this badly, it's a quality control thing. I do have an older Samsung, and I guess it's not the end of the world if the sfx come in a split second late, the rest of the game is smooth. I'll probably still release it but with a notice on Google Play about sound lag.
Ios do not have problems with latency.
 

O.Stogden

Member
Yes, unfortunately Android devices tend to have around a 20-60ms delay (depending on the device, it can go into the hundreds of ms) on any sound they play, not really noticeable in any circumstances except a game I guess.

iOS devices tend to have around a 7-12ms delay.
 
I'm making a Music Pad app, and have the same problem on Android, i tried everything but the latency is really huge making this app useless, I tried another game engine "Fusion 2.5" and there is no noticeable latency at all, but i really need to make my app using Game Maker Studio
4 years ago i contacted Game Maker Studio team and reported this issue, but they told me that they have no plan to resolve this anytime soon!
 
Top