Code example for SoundPool

Methods: setRatesetVolume

0
 
			 
			if (isPlaying) {
				float speed = getSpeed(x);	 // speed == pitch
				float volume = getVolume(y);
				soundPool.setVolume(streamId, volume, volume);
				soundPool.setRate(streamId, speed);
				xCoor.setText("X: "+x + " speed: " + speed);
				yCoor.setText("Y: "+y + " volume: " + volume);
			} 
			else { 
				xCoor.setText("X: "+x);
				yCoor.setText("Y: "+y);
			} 
			zCoor.setText("Z: "+z);
		}		 
	} 
	 
	/* do mapping 
	 * x --> speed 
	 * y --> volume