Cli clip = getClipFromSomewhere();
// Get the gain control from clip
FloatControl gainControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);
// set the gain (between 0.0 and 1.0)
double gain = 0.25;
float dB = (float) (Math.log(gain) / Math.log(10.0) * 20.0);
If you are having problems getting sound working on with Ubuntu on your Sony Vaio laptop then it may be caused by the External Amplifier being switched on. This was the case for me when I recently installed Jaunty on my VGN-T37GP.
To turn the External Amplifier off do the following.
Open the Volume Control
Goto Edit>Preferences and check External Amplifier
Goto new Switches tab in Volume Control and switch External Amplifier off
With some luck you should now have sound working on your laptop.