Code example for SoundPool

Methods: setVolume

			// 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;
Stop searching for code, let great code find you!  Add Codota to your java IDE