Author Topic: solved stop soundpool  (Read 1938 times)

Offline ggp

  • byte
  • *
  • Posts: 39
    • View Profile
solved stop soundpool
« on: February 14, 2014, 01:06:50 pm »
I know isn't jpc-ae but it is helpful  :D

Add functions at class SoundManager

Code: [Select]
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);

}


Code: [Select]

private int mStreamId;

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

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

« Last Edit: February 14, 2014, 02:01:41 pm by ggp »