Follow

I am getting a lot of sound latency when developing my game for Android. How can I get my sounds to play immediately?

Symptoms

  • I am developing a game on Android and I get a lot of sound delay when I play an AudioClip.

Cause

You have made a game for Android. When you are playing AudioClips in real-time there is an unacceptable amount of latency in the response you hear back.

Resolution

Typically, the audio-in latency needs to be below 25ms to be useable.

On iOS, audio-in latency is around 20ms, which is perfect for recording software or producing real-time effects. On Android, however, the latency is around 200-300ms, which causes a noticeable delay in the sound you hear in real-time.

A workaround you can try to fix this issue within Unity is change the DSP Buffer Size to set your audio to Best Latency in the Audio Manager:

  1. In the Unity Editor click Edit
  2. Click Project Settings
  3. Select Audio. You will see the DSP Buffer Size in the list of options within the Audio Manager in your Inspector view; Default, Best latency, Good latency, Best Performance.
  4. Select Best latency to see if this improves your audio response in real time.

More Information

There are various plugins on the Asset Store that may help with the sound quality within your project.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

1 Comments

  • 0
    Avatar
    Sirawat Pitaksarit

    If "Best Latency" setting (small buffer size) is still not enough for you going native is definitely the way to go. "Native Audio" asset store plugins can make a native call to both iOS and Android's fastest native way from one central interface. https://assetstore.unity.com/packages/tools/audio/native-audio-107067

    - On iOS it uses OpenAL. It is faster than AVAudioPlayer.
    - On Android it uses AudioTrack, which was confirmed to be faster than SoundPool and no difference from OpneSL ES.

    Edited by Sirawat Pitaksarit
Please sign in to leave a comment.