I'm adding a looping feature to a music app I am making, but I'm having a hard time getting this feature to work.
else if(item.getTitle().equals("STOP")){
item.setTitle("END");
this.isRecording = false;
for(DataClass dc : loopHolder){
spLoop.load(getActivity(), dc.getResID(), 0);
spLoop.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
@Override
public void onLoadComplete(SoundPool soundPool, int mySoundId, int status) {
loaded = true;
}
});
if(loaded) spLoop.play(dc.getResID(), 1, 1, 0, 0, 1);
LoopTimer timer = new LoopTimer(dc.getTimeSincePrevious(), 1000);
timer.start();
loaded = false;
}
return true;
}
dc is an arrayList that keeps track of which sound the user has played and the time between each sound. I'm having a really tough time figuring out why this isn't producing any sound. Any help is really appreciated.
Aucun commentaire:
Enregistrer un commentaire