Glad it worked! Your use of multiple MediaPlayers is an interesting approach. I current use only one, but latency is according to G1 user reports awful: 4 or 5 seconds, though I do not know yet if that is perhaps also due to the fact that Android forces me to first write synthesized sound to flash for lack of direct access to MediaPlayer's audio buffer, or due to the apparently lesser support for WAV (which I use) versus OGG according to David. In any case the emulator runs much faster for me.
On Nov 2, 5:20 pm, tobias429 <[EMAIL PROTECTED]> wrote: > Thanks for the tip! This actually does the trick. What I'm doing now > is a bit more complex. I've created a helper class that multiplies the > number of MediaPlayers used. So instead of using one MediaPlayer for > the bingSound, I use a new class, which internally creates an array of > MediaPlayers. bingSound is an instance of this helper class. If i call > bingSound.play(), the helper class initializes the first MediaPlayer > in the array and starts it. > > When bingSound.play() is called again, the helper class takes the > second MediaPlayer in the array and so on. With this I can fire off > the same sound very quickly several times, without having to make sure > that the sound has finished before it can be played once more. > > For all MediaPlayers created I set the onCompletionListener as you > suggested with the effect you described: the system does not fill up > with MediaPlayer remnants any more. > > With this everything works fine now. All in all pretty complex though. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

