Code example for SoundPool

Methods: autoPauseplay

0
		if(noFocus)
			return; 
		if(audioCEO.getRingerMode() != AudioManager.RINGER_MODE_NORMAL)
			return; 
		pause(); // pause music to make the end of the game feel more dramatic. hhheheh. 
		soundPool.play(
			soundID_gameOverPlayer,
			0.01f * PreferenceManager.getDefaultSharedPreferences(host).getInt("pref_soundvolume", 60), 
			0.01f * PreferenceManager.getDefaultSharedPreferences(host).getInt("pref_soundvolume", 60), 
			1,  
			0,  
			1.0f 
		); 
	} 
 
	public void resume() { 
		if(isInactive)
			return; 
		 
		soundPool.autoResume();
		startMusic(musicType,songtime);
	} 
	 
	public void pauseMusic() { 
		isMusicReady = false;
		if(musicPlayer != null) {
			try{ 
				musicPlayer.pause();
				isMusicReady = true;
			} catch(IllegalStateException e) {
				isMusicReady = false;
			} 
		} 
	} 
 
	public void pause() { 
		soundPool.autoPause();
		pauseMusic(); 
	} 
	 
	public void release() { 
		soundPool.autoPause();