The [lua]media.playEventSound()[/lua] can play more than one sound on Android. That is, it support audio mixing. The 1-3 second sound limitation is a limitation on both iOS and Android. On Android, it will not play a sound file that is larger than 1 MB, although Google’s documentation does not state if that 1 MB is the compressed or decompressed form in memory. As a general rule, only use it for short low latency sound effects.
Now, the reason why [lua]media.playEventSound()[/lua] is so much faster on Android is because we are using Android’s SoundPool class in Java, which is documented as their fastest audio API. See paragraph 3 in the documentation in the link below. That Java API loads sounds directly to the hardware.
http://developer.android.com/reference/android/media/SoundPool.html
The reason our [lua]audio[/lua] API has high latency on Android is because its audio is processed by a middle software layer (OpenAL) which is CPU bound before it is streamed out to the hardware. That middle layer is responsible for mixing all of the audio channels into a single stream and it then applies audio effects such as fades and volume level. This extra processing naturally adds latency and the more channels you have, the more latency you have. On iOS, OpenAL is supported and is hardware accelerated, which is why it is so much faster compared to Android. Google hasn’t provided a fast audio streaming API until Android 4.2 via OpenSL, but based on our testing, Android’s SoundPool class is still faster because it loads the sound directly to the hardware which bypasses that whole middle audio processing layer.
In any case, the above is the technical reason why one API is faster than the other. We do recognize that this is a pain for Corona developers to deal with and we want to look into updating our [lua]audio[/lua] API to make it easier so that you can code it the same for all platforms. Perhaps a new audio API designed for playing short low latency sound effects that bypasses audio processing, but still respects your volume settings.
In the meantime, a solution much like @george18’s up above will do the trick.
[import]uid: 32256 topic_id: 33899 reply_id: 135028[/import]