Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should be reasons to use OpenSL ES instead of AudioTrack in Android?

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?

like image 881
Alexander Kulyakhtin Avatar asked Jun 25 '12 20:06

Alexander Kulyakhtin


1 Answers

OpenSL ES:

Advantages:

  1. Low Level Audio API in Android
  2. Device Independent on Android Phones
  3. Good for Gaming

Disadvantages:

  1. Supports only on 2.3+ os

AudioTrack:

Advantages:

  1. High Level API

Disadvantages:

  1. Works on Java layer and Native code has to call javalayer to play audio.
like image 141
codetiger Avatar answered Nov 18 '22 23:11

codetiger