public void stop(int raw_id) { SoundInfo info = soundMap.get(raw_id); if (info.isComplete) { if (info.getStreamId() != null) { soundPool.stop(info.getStreamId()); info.setStreamId(null); } } }
public void play(int raw_id, boolean loop) { int intLoop = 0; if (loop) { intLoop = -1; } SoundInfo sInfo = soundMap.get(raw_id); try { int streamId = soundPool.play(sInfo.getSoundId(), 1.0f, 1.0f, 10, intLoop, 1); sInfo.setStreamId(streamId); } catch (Exception e) { } }