Java 控制音量

import javax.sound.sampled.*;

AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(
    new File("some_file.wav"));
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
FloatControl gainControl = 
    (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);
gainControl.setValue(-10.0f); // Reduce volume by 10 decibels.
clip.start();

转自:http://stackoverflow.com/questions/953598/audio-volume-control-increase-or-decrease-in-java

你可能感兴趣的:(Java)