googlearchive / android-audio-high-performance

We now recommend you use the Oboe libraries:
https://github.com/google/oboe
Apache License 2.0
719 stars 275 forks source link

Recommended Android API/Library to use for simple Audio effects playback? #114

Closed TheMaxCoder closed 5 years ago

TheMaxCoder commented 6 years ago

Hi first of all thanks for the great work you doing regarding Android Audio :) I have a quick question it is related more to SoundPool API and I was wondering if you guys can shed some light on it from your experience.

I'm working on drumming app, it simply plays sounds when the user taps on the screen and it works flawlessly on the Marshmallow and below.

But since the Android nougat came, if we set maxStreams to more than 10 when building SoundPool instance, it makes the app very laggy on Nougat and above when playing drums, like sound plays late or doesn't play at all (misses sounds) If we set it to 10 or lower it gets bit better but it misses the sounds when playing drums very fast which you can imagine can happen as we are limiting the maxStreams to only 10.

This issue is only on nougat and above. Marshmallow and below works flawlessly with maxStreams even set to 100.

I don't know what has changed in nougat that makes the SoundPool cause lags in the app. What could be the possible solution for this?

Or what you think is a better alternative to SoundPool when the purpose of the app is just to play some sounds effects (ogg files) when a user taps on the screen.

I would really appreciate the input of you guys on this one if you can guide me in the right direction.

Thanks a lot :)

codingjeremy commented 5 years ago

This sample has been deprecated/archived (check README for more information on newer samples related to this technology).

As recommended by GitHub, we are closing all issues and pull requests.