Code example for SoundPool

Methods: playsetRate

0
     */ 
    public boolean playLevelUp(float balance, float percentage, int pitchLevel){
 
        float curVolume = (float)Math.pow( sfxVol*percentage, sfxScaleFactor );
 
        boolean returnMe = LevelUp.setStreamID( sfx.play(LevelUp.getSoundID(),
                curVolume-(curVolume*balance), curVolume+(curVolume*balance), 0,  0, 0) );
 
        sfx.setRate(LevelUp.getStreamID(), 1+( ( (float)pitchLevel ) / 10.0f) );
 
        return returnMe;
    } 
 
    /** 
     * When the player's score multiplier is about to run out of time, this jingle should be played. 
     * Once. 
     * 
     * @param balance       The left/right stereo balance with which you want to play the sound. 
     * @param percentage    The percentage of the current sfx volume the sound should be played at. 
     * @return A boolean of whether or not the sound was played successfully. 
     */