I've got a problem with this Code.. I tried to play some sound, which is in the Musik directory in Eclipse. I already tested, if the sound exist, can be read, and can be opened. All looks ok. But I can't hear anything.
package mhm;
import java.applet.Applet;
import java.applet.AudioClip;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
public class Main {
public static void main(String[] args) {
new Main();
}
URL url = null;
AudioClip clip;
File file = new File("Musik/VOWZN-UnRational.wav");
public Main() {
try {
url = new URL("file://" + file.getPath());
} catch (MalformedURLException e) {
e.printStackTrace();
}
clip = Applet.newAudioClip(url);
clip.play();
new Menu();
}
}
On Runtime, there aren't any errors..