Repeating a sound

All your problems with Audio, Video and Images.

Repeating a sound

Postby jordanstreet » Tue Jan 04, 2011 6:27 am

Hey guys I'm building a metronome and am using the MediaPlayer.
Code: Select all
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
jordanstreet
Freshman
Freshman
 
Posts: 2
Joined: Wed Jul 21, 2010 5:30 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 19 guests