I am getting an Expected Identifier error when trying to compile an applet with AudioClip.
I plan on adding this to a JFrame, and I was hoping to get the AudioClip to loop.
import java.applet.*;
import java.awt.*;
public class Audio extends Applet
{
AudioClip sound = getAudioClip(getCodeBase(), "myssy.au");
sound.loop();
}//end of Audio Applet
Use a
Clip– see the example on the Java Sound info. page. It uses aJOptionPanerather than aJFrame(to prevent the daemon thread of theClipfrom stopping at the end ofmain()), but the principle is the same.