Hi,
I'm creating a sampler app for school, I've made a code wich plays a sample when I press and hold a button and stops when I release it. My problem is that it has too many latency, it takes too long after I press the button to play the sound.
here's my code:
smpl1.setOnTouchListener(new View.OnTouchListener()
{
public boolean onTouch(View arg0, MotionEvent theMotion)
{
switch (theMotion.getAction())
{
case MotionEvent.ACTION_DOWN:
sample = MediaPlayer.create(MainActivity.this, R.raw.bassdrum);
smpl1.setText("ON");
smpl1.setTextColor(Color.GREEN);
sample.start();
break;
case MotionEvent.ACTION_UP:
smpl1.setText("OFF");
smpl1.setTextColor(Color.RED);
sample.stop();
break;
}
return true;
}
my audio files are now mp3's..
thanks!

