Code example for SoundPool

Methods: playstop

0
		} 
 
		if (mSoundId.get(inResourceID) != null) {
			//Log.v("VIEW", "Found existing sound " + inResourceID + ", stopping and removing it from progress and id check");	 
			int a = mSoundId.get(inResourceID);
			mSoundPool.stop(a);
			mSoundProgress.remove(a);
			mSoundId.remove(inResourceID);
		} 
		 
		int streamId = mSoundPool.play(inResourceID, (float)inVolLeft, (float)inVolRight, 1, inLoop, 1.0f);
		mSoundId.put(inResourceID, streamId);
		mSoundProgress.put(streamId, (long)0);
		return streamId;
	} 
	 
	static public void stopSound(int inStreamID)
	{ 
		if (mSoundPool != null) {
			mSoundPool.stop(inStreamID);
			mSoundProgress.remove(inStreamID);