📜  如何控制剪辑音量java代码示例

📅  最后修改于: 2022-03-11 14:52:35.434000             🧑  作者: Mango

代码示例1
public static void play(Clip clip) {
    if (Settings.getSettings().isVolumeOn()) {
        FloatControl volume = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);
        volume.setValue(-1 * Settings.getSettings().getVolume());
        clip.start();
    }
}