Noob here - Just getting into android programming

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Noob here - Just getting into android programming

Postby djcrunchy » Thu Feb 12, 2009 9:07 am

Hey there, lil bio before I noob it up.

I know my way around more than a few programming languages, and i took java in school, but its far from my strong point.

My question is this..
Whats the best way to play a sound clip repeatedly? The way I'm doing it right now...

Decoration -
MediaPlayer kick1 = MediaPlayer.create(this,R.raw.kick1);

Calling -
kick1.start();

...It crashes after.. 27 or so plays...
I spent some time reading, and i tried to figure out the best way to do this, but I'm stuck and so I'm here.
I tried:
-Stopping the clip
-re-preparing the clip;
-setting the seekTo(0) and replaying it..
...All of which either crashed it or did nothing..

Thanks In Advance

Crunchy
djcrunchy
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Feb 12, 2009 9:00 am

Top

Postby bit » Fri Feb 13, 2009 2:57 am

The book Hello Android says MediaPlayer is very touchy; you might check it or its code for using it:

http://www.pragprog.com/titles/eband/source_code
bit
Junior Developer
Junior Developer
 
Posts: 19
Joined: Thu Dec 11, 2008 7:30 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 8 guests