Sound.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:GameUtils 作者:
/**
 * Loops the Clip. If the sound is off, the volume is set to the minimum.
 * @param name The name of the Clip to loop.
 */
public void loop(String name) {
    Clip c = get(name);

    if(c != null) {
        c.stop();
        c.flush();
        c.setFramePosition(0);

        if(!on) {
            FloatControl volume = (FloatControl)c.getControl(FloatControl.Type.MASTER_GAIN);
            volume.setValue(volume.getMinimum());
        }

        c.loop(Clip.LOOP_CONTINUOUSLY);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号