I need to loop the one sound so that the timer will make it so the sound will play then delay 5 seconds and then play again.
My source code is:
import java.awt.*;
import javax.swing.*;
import java.applet.AudioClip;
public class Morning extends JApplet
{
private AudioClip rooster;
private final int dealy = 5000;
private Timer t;
public Morning()
{
t = new Timer(delay, this);
}
public void init()
{
rooster = getAudioClip(getDocumentBase(),
"roost.wav");
rooster.play();
t.start();
Container c = getContentPane();
c.setBackground(Color.white);
}
}
Can anybody please help me?