Code example for SoundPool

Methods: unload

0
        // get sound id and remove from mPathSoundIDMap 
        Integer soundId = this.mPathSoundIDMap.remove(path);
         
        if (soundId != null){
            // unload effect 
            this.mSoundPool.unload(soundId.intValue());
             
            // remove record from mSoundIdStreamIdMap 
            this.mSoundIdStreamIdMap.remove(soundId);
        } 
    } 
     
    public int playEffect(String path){
        Log.i(TAG, "playEffect "+path);
        Integer soundId = this.mPathSoundIDMap.get(path);
         
        if (soundId != null){
            // the sound is preloaded 
             
            // play sound 
            int streamId = this.mSoundPool.play(soundId.intValue(), this.mLeftVolume,