}
Control.Type vol1 = FloatControl.Type.VOLUME, vol2 = FloatControl.Type.MASTER_GAIN;
if (this.clip.isControlSupported(vol1)) {
FloatControl volumeControl = (FloatControl) this.clip
.getControl(vol1);
volumeControl.setValue(volume);
}
else if (this.clip.isControlSupported(vol2)) {
FloatControl gainControl = (FloatControl) this.clip
.getControl(vol2);
float dB = (float) (Math.log(((volume == 0.0) ? 0.0001 : volume))
/ Math.log(10.0) * 20.0);
gainControl.setValue(dB);
}
}