solved stop soundpool

Started by ggp, February 14, 2014, 01:06:50 PM

Previous topic - Next topic

ggp

I know isn't jpc-ae but it is helpful  :D

Add functions at class SoundManager


public synchronized int playID(int id) {
if (res == null || GameConfig.soundMul == 0) {
return 0;
}
times[id] = Ticker.getTime();
return soundPool.play(ids[id], 0.75f * GameConfig.soundMul, 0.75f * GameConfig.soundMul, 0, 0, 1);
}

public synchronized void stopID(int id) {
if (res == null || GameConfig.soundMul == 0) {
return;
}
soundPool.stop(id);

}





private int mStreamId;

//for play
mStreamId=SoundManager.getInstance().playID(SoundManager.COLLECTED);

//for stop
SoundManager.getInstance().stopID(mStreamId);