Code example for SoundPool

Methods: setRate

0
                silentPause = true; 
                beeping = false; 
                thread.interrupt(); 
 
            } else if (beeping) {//just stay beeping and alter the rate 
                soundPool.setRate(tone_1000_stream, getRateFromTone1000(var)); 
 
            } 
 
            if (var <= sinkAudioThreshold && !sinking && !beeping) {//need to start sinking 
                beepOn = false; 
                sinkOn = true; 
                silentPause = false; 
                sinking = true; 
                thread.interrupt(); 
            } else if (var > sinkAudioCutoff && sinking) {//need to stop sinking 
                beepOn = false; 
                sinkOn = false; 
                silentPause = true; 
                sinking = false; 
                thread.interrupt(); 
 
            } else if (sinking) { 
                // just stay sinking and alter the rate; 
                soundPool.setRate(sink_stream, getRateFromTone500(var)); 
            } 
 
 
        }