Code example for SoundPool

Methods: load

0
		Log.v("Sound","Get sound handle ------" + inFilename + " = " + id);
 
		int index;		
		 
		if (id > 0) {
			index = mSoundPool.load(mContext, id, 1);
			Log.v("Sound", "Loaded index: " + index);
		} else { 
			Log.v("Sound", "Resource not found: " + (-id));
			index = mSoundPool.load(inFilename, 1);
			Log.v("Sound", "Loaded index from path: " + index);
		} 
 
		int duration = getDuration(inFilename);
		mSoundDuration.put(index, (long)duration);
 
		return index;
    } 
	 
	public static String getSoundPathByByteArray(byte[] data) throws java.lang.Exception
	{