- Home /
Android audio lag solutions
I know of the supposedly improved solution that is :
Project > Settings > Audio > DSP Buffer Size = Best Latency
But unfortunately, sound effects still play with a pretty bad lag (Unity3D v5.4.x).
Apart from the Android Native Audio (ANA) plugin in the asset store, is there any current fix regarding the audio latency ?
How do you guys deal with this problem in your games ?
Answer by 5argon · Apr 14, 2018 at 06:20 AM
If "Best Latency" setting is still not enough for you going native is definitely the way to go. I just made Native Audio asset store plugins which can make a native call to both iOS and Android's fastest native way from one central interface. https://www.assetstore.unity3d.com/#!/content/107067
There are various ways of playing audio at native side, here's my choice :
On iOS it uses OpenAL. It is faster than AVAudioPlayer, AudioToolbox, and SystemSound.
On Android it uses AudioTrack, I confirmed it to be faster than SoundPool and no meaningful difference from C++ side OpneSL ES of NDK.
I have compiled all of my findings in here : http://exceed7.com/native-audio
For your information, Android Native Audio (ANA) uses SoundPool
as its solution. It is already fast but not the fastest. However, my approach which uses AudioTrack
is much more limited in flexibility. (Such as an amount of concurrency you can have, etc.)
This solution does not to be on the Asset store any more.
Your answer
Follow this Question
Related Questions
AudioClip huge lag on some android devices 0 Answers
Sound Cracks or Lags on ZTE Blade? 0 Answers
Major Latency on Android when using Microphone 1 Answer
Microphone Input Latency Android 1 Answer
Rhythm game input latency issue 0 Answers