Currently I'm using AudioTrack passing to it audio data from native layer to play.
It seems I can use OpenSL ES in the native layer instead of AudioTrack in Java. What are the supposed advantages OpenSL ES gives as opposed to AudioTrack?
Currently I'm using AudioTrack passing to it audio data from native layer to play.
It seems I can use OpenSL ES in the native layer instead of AudioTrack in Java. What are the supposed advantages OpenSL ES gives as opposed to AudioTrack?
OpenSL ES:
Advantages:
Disadvantages:
AudioTrack:
Advantages:
Disadvantages:
While this is old, others will come here from a search, as I did. I use Android 7 on a rather slow and low-powered tablet (Onda V10 4G, MediaTek processor) with no other app active. When playing .ts files recorded from television, I found that audio had continuous dropouts over Bluetooth, though it was fine through the tablet's speaker (and presumably headphones, though I didn't test). Audio output was set to the default OpenSL ES. I changed to AudioTrack, and audio is now fine, even for files accessed over a network. VLC current as of 1 August 2021. BTW, over Bluetooth I found that sound and subtitles matched what was on the screen (no huge offsets as I have sometimes found), though lip-sync was not exact). I didn't try to compensate for delay, left at default.
Files played fine through Kodi.
So in this case compelling reason to use AudioTrack. There may be settings to make OpenSL work, but I didn't bother.