Code example for SoundPool

Methods: play

0
            } else { 
                mSoundPool.play(mSoundIDs[index], 1f, 1f, 0, 0, 1f);
            } 
        } 
 
        @Override 
        public void onLoadComplete(SoundPool pool, int soundID, int status) {
            if (status != 0) {
                Log.e(TAG, "loading sound tracks failed (status=" + status + ")");
                for (int i = 0; i < mSoundIDs.length; i++ ) {
                    if (mSoundIDs[i] == soundID) {
                        mSoundIDs[i] = ID_NOT_LOADED;
                        break; 
                    } 
                } 
                return; 
            } 
 
            for (int i = 0; i < mSoundIDs.length; i++ ) {
                if (mSoundIDs[i] == soundID) {
                    mSoundIDReady[i] = true;