Code example for SoundPool

Methods: setVolume

0
 
			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				lastSpeed = progress;
				float volume = calcVolume();
				soundPool.setVolume(streamId, volume, volume);
 
			} 
		}); 
	} 
	 
	private void play(int clip) {
		// max simultaneous sound is one 
		Log.d(TAG , "Playing " + clip);
		float volume;
		if(idleSoundId == clip) {
			volume = 0.5f;
		} else { 
			volume = calcVolume();
			 
		}