MediaPlayer stops working after 30 uses?
I'm trying to write a function to play a short sound (in /res/raw) in my
program, called at effectively random times throughout the program. So far
I have this function:
public void playSound() {
MediaPlayer mp = new MediaPlayer();
mp = MediaPlayer.create(this, R.raw.ShortBeep);
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
mp.setLooping(false);
mp.start();
}
It works fine for awhile, but after exactly 30 plays of the sound, it
stops making sound.
No comments:
Post a Comment