title: .wav sounds not playing in Java
body: <p>I am currently using this function to play .WAV files</p>
  
  <pre><code>public void playSound(String sound){
      try {
           // Open an audio input stream.
           URL url = this.getClass().getClassLoader().getResource(sound);
           AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);
           // Get a sound clip resource.
           Clip clip = AudioSystem.getClip();
           // Open audio clip and load samples from the audio input stream.
           clip.open(audioIn);
           clip.start();
        } catch (UnsupportedAudioFileException e) {
           e.printStackTrace();
        } catch (IOException e) {
           e.printStackTrace();
        } catch (LineUnavailableException e) {
           e.printStackTrace();
        }
  }
  </code></pre>
  
  <p>The problem is that no sound is being played when I call the function on a file, no errors or exceptions are thrown or whatsoever the program just starts  and stops, no sound plays, I tried with a lot of different .WAV files with no success.</p>