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

Issue

Table of Contents

At present, I’m currently using AudioTrack that is passing on audio data from the native layer and playing it back to.

It appears that I could use OpenSL ES in the native layer, instead in place of AudioTrack using Java. What are the supposed benefits that OpenSL ES has over to AudioTrack?

Solution

OpenSL ES

Advantages:

  1. API for Low-Level Audio on Android
  2. Device independent on Android phones
  3. Good for gaming

Disadvantages:

  1. Only supported on 2.3+ OS

You will also like to read ‘HP Flyer Red 15.6″ 15-f272wm Laptop with Intel Pentium N3540 Processor [Review].’

AudioTrack:

Advantages:

  1. API at High Level

Disadvantages:

  1. It works with Java layer. Native code must call Javalayer in order to listen audio.

You will also like to read ‘What is Android wearable storage?’

Conclusion

We hope that you got the answer for ‘What should be reasons to use OpenSL ES instead of AudioTrack in Android?’. If you have any other queries, please comment below. We would love to help you.

Leave a Comment

x