I have created an array of sounds that is randomly accessed to play via MediaPlayer when a button is pressed - this works fine my only issue is that when testing it and pressing the button rapidly the sound would stop and not play anymore - is there some way I can implement a start stop thing? I tried beginning my onClick method with a butPress.stop() but my android emulator didn't like it. the code follows :
public void onClick(View arg0) {
try{
display.setText(pp.getText());
int x = r.nextInt(sfx.length);
butPress = MediaPlayer.create(PitchMaker.this, sfx[x]);
butPress.start();
}catch(Exception e){
display.setText("Whoops we had a problem. Please try again");
}
}