954,180 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Need help with looping some sounds

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?

cody_e
Newbie Poster
4 posts since Mar 2004
Reputation Points: 10
Solved Threads: 0
 

Is there like anybody here. I posted this like 2 days ago.

cody_e
Newbie Poster
4 posts since Mar 2004
Reputation Points: 10
Solved Threads: 0
 

were all dumb and dont know ??? no just joking .. youll find someone once there online...

RC_Razor
Junior Poster
156 posts since Feb 2004
Reputation Points: 18
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You