Note: Nothing is displayed on the applet, only the sound is playing
Java Code
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
public class LoopAudio extends JApplet
{
String audioFilename = "happyDaze.wav";
AudioClip ac;
public void init( )
{
ac = getAudioClip( getCodeBase( ), audioFilename );
ac.loop( ); // loop instead of play
}
public void stop( )
{
if( ac != null ) // can't stop it if it isn't running
ac.stop( );
}
}
©2006 by E.S.Boese. All Rights Reserved