import java.io.File;
import java.io.IOException;
class Learning {
public static void main(String[] args)
throws SecurityException, IllegalStateException,
UnsupportedAudioFileException,
IOException, LineUnavailableException {
AudioInputStream audioInputStream =
AudioSystem.getAudioInputStream(
new File("D:\\jaVA items\\BabyElephantWalk60.wav"));
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
clip.loop(Clip.LOOP_CONTINUOUSLY);
clip.start();
}
}
This is the code , I wanted the file to be played infinite. Actually I am a beginner so I thought doing things practically will be a greater choice . I admit that I copied some lines of code from some different webs. If there are any alternatives for this thing , playing sounds , please tell me . Thanks in Advance !!!!!!!!!!!!