title: Why doesn't this code play the sound?
body: <p>So I have this code which is supposed to play an audio-file. It doesn't, despite compiling just fine and running without errors. FYI: file is in source-folder/speakers are on.</p>
  
  <pre><code>import java.io.File;
  import javax.sound.sampled.AudioSystem;
  import javax.sound.sampled.Clip;
  
  public class SoundCheck {
  public static void main(String[] args) {
  
      File song = new File("test.WAV");
      PlaySound(song);
  }
  static void PlaySound(File Sound) {
      try {
          Clip clip = AudioSystem.getClip();
          clip.open(AudioSystem.getAudioInputStream(Sound));
          clip.start();
  
          Thread.sleep(clip.getMicrosecondLength()/1000);
      }
      catch (Exception e){
      }               
  }
  }
  </code></pre>