| | |
Need help with looping some sounds
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2004
Posts: 4
Reputation:
Solved Threads: 0
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?
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?
![]() |
Similar Threads
- Unwanted Sounds on PC. Help! :( (Windows NT / 2000 / XP)
- Wierd sounds from pc! (Windows NT / 2000 / XP)
- Playing Multiple Sounds On VB6 (Visual Basic 4 / 5 / 6)
- special keys as inputs (Game Development)
- Can you add pictures/sounds in a win32 console app? (C)
Other Threads in the Java Forum
- Previous Thread: help!! My applet can't run... Urgent!!
- Next Thread: Read and write to an ASCII Text file
| Thread Tools | Search this Thread |
Tag cloud for Java
affinetransform android api append apple applet application arguments array arrays automation bi binary bluetooth businessintelligence busy_handler(null) chat class classes client code component database draw eclipse encryption equation error event exception fractal game givemetehcodez graphics gui html ide image input integer intersect j2me java javaexcel javaprojects jmf jni jpanel julia linked linux list loop main map method methods mobile netbeans newbie number open-source oracle oriented panel print problem program programming project properties qt recursion reference replaysolutions repositories return robot scanner screen scrollbar se server set singleton size sms socket sort sql string swing test threads time tree utility windows xor xstream





