What are my options for playing simultaneous audio on an Android device with the least amount of latency? Am I going to get anything half decent out of the canned SDK, or is that asking too much? The documentation claims that the SoundPool class is capable of playing multiple sounds simultaneously with relatively good performance, but after running some tests in the emulator and on a physical device it seems pretty weak. Is there maybe a trick to it, or do I have to go to a much lower level api for this kind of thing? I've tried using a single sound pool with multiple samples loaded, and I've tried multiple sound pools each managing a single sample. I'm preloading everything, so that when I attempt to play back I have no additional code being executed other than the call to SoundPool.play().
A number of people are interested in low-latency audio on Andriod. Here are the threads I'm following on the topic:
This post suggests that Android devices have ALSA drivers (capable of low-latency audio)--but it seems that low-latency functionality isn't exposed to apps via the NDK.
I have no direct experience with Android, but from what I've read, low-latency (less than <10ms or so) isn't a reality yet. Please post any experience to the contrary!
Android 2.3 now supports native access to audio APIs (via OpenSL) for low latency applications.
However, not all hardware devices will have the a low latency audio feature profile. Thus applications requiring low latency audio shouuld filter devices not supporting it in the Android market by specifying the following in the manifest:
<uses-feature android:name="android.hardware.audio.low_latency"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With