jordanstreet
Lurker
Hey guys I'm building a metronome and am using the MediaPlayer.
the run method is called in regular intervals. There is a delay between the first and second click then it seems to run smoothly. Even so at higher tempos I feel like it is phasing in and out of time. Also the fastest the sound will play is about every 300ms anything faster and there is no noticeable difference.
Any thoughts?
Thanks,
Jordan
Code:
MediaPlayer mp;
.....
public void run() {
if(playing) {
mp.seekTo(0);
mp.start();
}
else
{
mp = MediaPlayer.create(getBaseContext(), R.raw.cowbell);
mp.start();
playing = true;
}
}
the run method is called in regular intervals. There is a delay between the first and second click then it seems to run smoothly. Even so at higher tempos I feel like it is phasing in and out of time. Also the fastest the sound will play is about every 300ms anything faster and there is no noticeable difference.
Any thoughts?
Thanks,
Jordan