Hello!
I write a command line program with java on eclipse. I use this code to get a sound from the beep.wav file. But i can not hear anything from the eclipse.
try
{
File curdir = new File (".");
File soundFile=new File(curdir.getCanonicalPath() + "\\beep.wav");
Clip clip = AudioSystem.getClip();
AudioInputStream inputStream = AudioSystem.getAudioInputStream(soundFile);
clip.open(inputStream);
clip.start();
clip.start();
clip.start();
}
catch(Exception e)
{
System.out.println("error: " + e.toString());
}
When i use beep.mp3 it gives me file is not supported format exception. But with wav i don't get any error.
So why it does not play any sound?
Thank you!