I've got an interesting situation with the android MediaPlayer. I've got about 30 sounds that I need to play in an activity. I'm getting strange results that I'm not sure are coming from memory issues or not...
The reason why I need to use media player is that I've got a timed flow to the sounds where one sound needs to play after the other in a certain order. I also use the callbacks to see which sound is played next. Thus, soundpool is out...
I've tried loading each sound in to it's own media player using MediaPlayer.create(). Now, this works fine on my device, a Samsung Galaxy S Vibrant. My client with a Samsung Ace, however is getting null pointer exceptions when I try to set the onCompletionListener, meaning .create() returned null on his device but not mine.
So, I switched from loading them all at once to loading them on the fly in the onCompletionListener of the previous sound using this method
This kind of works, the fist 3-4 sounds play and then it hangs on my client's device (still works fine on my device). Which I'm assuming it's hanging on the .prepare()
This is incredibly hard to sort out since my client has no real knowledge of logcat and no SDK to debug, and it works fine on my device. It even hangs on his second device which is the same model as mine.
Anyone have any idea what might be causing this or how to debug it?
I'm thinking my next step will be to simply just use the one MediaPlayer and use the mp parameter of OnCompletionListener to load up the next sound on the same media player. I'll post my findings.