Code example for SoundPool

Methods: setVolume

0
			// for every advance on the scrollbar 
			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				lastSpeed = progress;
				float volume = calcVolume();
				soundPool.setVolume(streamId, volume, volume);
				 
			} 
 
			public void onStopTrackingTouch(SeekBar seekBar) {
				accelerating = false;
				playIdleOrCruise(); // we've reached our desired speed 
			} 
		}); 
	} 
	 
	private void play(int soundId) {
		// max simultaneous sound is one 
		Log.d(TAG , "Playing " + soundId);
		float volume;
		if(idleSoundId == soundId) {