Hi all,
Here 's the trouble I've been dealing with for several days.
I'm building a small game with JAVA and I would like to play sounds inside.
Here's my code :
try {
testUrl = new URL("file:" + new File(".").getCanonicalPath() + "/" +
filename);
testClip=Applet.newAudioClip(testUrl);
testClip.play();
}catch(Exception e){
System.out.println(testUrl);
}
It looks good, but it doesn't work !!!
I hear nothing, although I'm sure there is a file at the position pointed to
by testUrl.
I insist that it is a JAVA application (not an applet).
I use JBuilder X.
Any suggestion ?
Thanks in advance