How to use Android audio with low latency

Problem:

As you may have heard, Android does not support low latency audio. What I mean by low latent sound is that you should receive sound signals from the microphone and play sound without a significant amount of time between (for example, 5-7 ms).

I tried the old java (with AudioRecord and AudioTrack) and the "new" OpenSL ES. They are terrible and make the application unusable. The issue has been well documented here. BTW, iOS API can produce a delay of 5-7 ms.

Search for workarounds:

But I'm still trying to make a low latency sound. Something like this answer describes.

“However, I was able to achieve this satisfactorily by writing my own code that made moving inside and accessing the low-level audio playback API only to play the final mixed output. Higher audio playback levels in the .Net Compact Framework are theoretically capable of polyphony, but in practice, they work terribly (a lot of glitches, stuttering and distortion).

Does this make sense for Android? The answer is discouraging.

So my question. Is there really no way to achieve a 10-minute audio delay with Android?

Honestly, I do not expect a solution in the near future, but I just want one great mind to have an answer to this problem.

+7
source share
3 answers

android 4.1+ has a low latency audio api that should give you less than 10ms latency. however, the value varies depending on the hardware (welcome to the rich and diverse world of android).

there is also a function descriptor "android.hardware.audio.low_latency", which can be used for filters that do not have low latency support.

check out http://www.youtube.com/watch?v=Yc8YrVc47TI&feature=player_de%20tailpage#t=1366s

and this: http://createdigitalmusic.com/2012/07/android-high-performance-audio-in-4-1-and-what-it-means-plus-libpd-goodness-today/

+4
source

There is currently no way to get low latency sound on Android devices without changing the operating system, and even then most of the delay can come from the hardware implementation, so the software cannot fix it. This is sad since the Linux kernel is very capable of audio latency and less than 5 ms, and many ARM hardware is capable of a decent delay. I had the usual Linux build running on the old Palm TX , and actually had pretty decent latency.

+3
source

as a continuation of the android.hardware.audio.pro function, starting with Android 6 promises <20 ms round trip, that we can hope that it should be less than 10 ms.

+3
source

All Articles