Here is my very short test method:
public static void main(String[] args) {
try{
File sound = new File("./res/bird.wav");
AudioInputStream stream = AudioSystem.getAudioInputStream(sound);
AudioFormat format = stream.getFormat();
DataLine.Info info = new DataLine.Info(Clip.class, format);
Clip clip = (Clip) AudioSystem.getLine(info);
clip.open(stream);
clip.start();
Thread.sleep(clip.getMicrosecondLength() / 1000);
}catch (Exception e){
e.printStackTrace();
}}}
I get no errors, however the file doesn't play. I've tested with multiple different wav files, but none of them have been playing?
EDIT: Could it be something to do with me being on linux? Pulseaudio does not show any sound output. Also, I'm using Eclipse.