Code example for SoundPool

Methods: setOnLoadCompleteListener

0
	private  int playTime = 300; // 300 msec. to play sound effect
	private  PlayTask muzPlay;
	 
	public SoundEngine(Context context){
		mContext = context;
		mSoundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);
	    mSoundPoolMap = new SparseArray<Integer>();
	    mVolumeMap = new SparseArray<Float>();
	    mLoadComplete = new SparseArray<Boolean>();
	    mSoundPool.setOnLoadCompleteListener(new OnLoadCompleteListener(){
 
			public void onLoadComplete(SoundPool soundPool, int sampleId,
					int status) {
				if (delayPlay){
					if (delayLooped){
						playLoopedSound(sampleId);
					}else{ 
						playSound(sampleId);
					} 
				} 
Stop searching for code, let great code find you!  Add Codota to your java IDE