The 2 methods of which I am aware are:
Of the two, which is faster? If there are other alternatives, please enlighten me.
Further details: Assume that my application will be playing sounds that are predisposed to the native hardware's format. E.G., if the native playback sample rate is 44.1KHz, I will feed it a 44.1K sound. If instead the native sample rate is 48KHz, I will feed it a 48KHz sound. No system mixer or re-sampler should be necessary.
Last time I checked the Android source code, the only two APIs that would use the low-latency path added in Jellybean were OpenSL ES
and SoundPool
(and maybe ToneGenerator
as well, but I guess that's irrelevant here).
If you've got a bunch of static sounds, using a SoundPool
would be the most convenient option. For real-time generated audio you'll have to use OpenSL ES.
For the list of conditions that need to be met for the low-latency path to be chosen, I refer you to the source code of libaudioflinger and libwilhelm. Short summary: Use the native sample rate, mono or stereo linear PCM, no effects.