Question: This sound so simple that I can't figure out why I can't find the answer lol 

I have a working sound pool class (thanks to a tutorial and some tweaking I did), and it works fine. 

the problem now is that I want to be able to change my background music randomly. (not always have the same music in a loop but have 2 or 3 and when one finishes I play one of the 2 others).

problem is I can't find a way to get notified that the music has finished playing.

Any ideas ? 

Jason

Answer: 
It can't be done with SoundPool as far as I can tell.

The only audio 'player' that I know which can provide a completion notification is 
[MediaPlayer](http://developer.android.com/reference/android/media/MediaPlayer.html) - it's more of a complex beast than SoundPool but allows setting an OnCompletionListener to be notified when playback is complete.
MediaPlayer is heavy and slow compared with SoundPool, but SoundPool doesn't have setOnCompletionListener. To cope with this issue I implemented a [custom class](https://github.com/genhau/SoundPoolPlayer) from SoundPool with setOnCompletionListener.

usage: similar to MediaPlayer

creation:
---------

```
SoundPoolPlayer mPlayer = SoundPoolPlayer.create(context, resId);
mPlayer.setOnCompletionListener(
    new MediaPlayer.OnCompletionListener() {
        @Override
        public void onCompletion(MediaPlayer mp) {  //mp will be null here
            Log.d("debug", "completed");
        }
    };
);
mPlayer.play();

```

pause:
------

```
mPlayer.pause();

```

stop:
-----

```
mPlayer.stop();

```

resume:
-------

```
mPlayer.resume();

```

isPlaying:
----------

```
mPlayer.isPlaying();

```

any pull request is welcomed. I only implemented what I need here.