Instead of this:
File curdir = new File (".");
File soundFile=new File(curdir.getCanonicalPath() + "\\beep.wav");
try this:
File soundFile = new File(System.getProperty("user.dir") + "\\beep.wav");
As well make sure that "beep.wav" is spelled correctly, it is case sensitive including the extension. (as far as Java is concerned .WAV is different from .wav)
turt2live
Junior Poster in Training
85 posts since Jan 2011
Reputation Points: 15
Solved Threads: 3
as for the exception, java doesn't support mp3 by default, you would need to get (or write :) ) packages that do that for you.
wav files don't give errors, because they are supported
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433