Controlling the Volume of Playing Sampled Audio To create a DataLine object, see ``Loading and Playing Sampled Audio'' and ``Playing Streaming Audio''. // Set Volume FloatControl gainControl = (FloatControl)dataline.getControl( FloatControl.Type.MASTER_GAIN); double gain = .5d; // number between 0 and 1. float dB = (float)(Math.log(gain)/Math.log(10.0)*20.0); gainControl.setValue(dB); // Mute On //The next three lines should all be in one line BooleanControl muteControl = (BooleanControl)dataline.getControl( BooleanControl.Type.MUTE); muteControl.setValue(true); // Mute Off muteControl.setValue(false);