Code example for SoundPool

Methods: playstop

0
	public void playLooped(int sound, int loop, float rate, int side){
		stopSound(0);stopSound(1); 
		if (loaded){
			soundID=soundMap.get(sound);
			//id, left volume, right volume, priority of sound, loop, rate of play 
			if (side==0) soundPool.play(soundID, 0.0f, volume, 1, loop, rate);
			else soundPool.play(soundID, volume, 0.0f, 1, loop, rate);
		} 
		stopSound(sound);
	} 
	 
	public void stopSound(int sound){
		soundID=soundMap.get(sound);
		if(soundID != null)
			soundPool.stop(soundID);
	} 
 
	public boolean isWiredHeadsetOn() { 
		return  audioManager.isWiredHeadsetOn();
	} 
}