Thursday, October 20, 2011

[android-developers] Playing a sound several times

i have the following problem:
when i try to play a sound over and over again, it sometimes (actually
most times) is not played.
the documentation says that one should use the media player in the
following sequence if a sound should be played several times:

private MediaPlayer mediaPlayer;

onCreate(){
mediaPlayer = MediaPlayer.create(JogoActivity.this, R.raw.new_pop);
mediaPlayerPrepare();
}

method(){
mediaPlayer.start();
}

mySecondMethod(){
method();
method();
method();
method();
}
is this the wrong approach?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment