Game music that plays in the background - Java javax.sound.sampled

Java examples for javax.sound.sampled:Sound

Description

Game music that plays in the background

Demo Code


//package com.java2s;

import java.applet.AudioClip;

public class Main {
    static AudioClip gameClip, rightClip, wrongClip;

    /**/*from ww w  . jav a  2  s .c  o m*/
     * Game music that plays in the background
     */
    static void loopGameMusic() {
        try {
            gameClip.loop();
        } catch (Exception e) {
            System.out.println("loopgamemusic caught exception"
                    + e.getMessage());
        }
    }
}

Related Tutorials