Using MediaPlayer or SoundPool

There are a couple of strategies as far as I understand, which I presented in a previous post of yours: Tracking high score for android

If you place your mp3 file in the data folder, you should be able to do this:

mp.setDataSource(dataPath("youraudiofile.mp3"));

You can also use the assets manager. Or explore examples working with external storage options.

Here I have an example playing sound tested on Android: A sound play exemplar please?

Notice that there might be some changes in Android Mode version 4.0.2 that Andres have implemented, as discussed [here])(https://github.com/processing/processing-android/issues/450#issuecomment-398517160).

Kf

1 Like