title: Java Application won`t play sound
body: <p>I wrote a program to play a bird sound. I got no errors when launching it but there was no sound. I'm running Netbeans IDE. Any ideas or solutions?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>package JavaFactoryPatternExample;
  
  
  import java.io.File;
  import javax.sound.sampled.AudioSystem;
  import javax.sound.sampled.Clip;
  
  public class TutorialSound {
  public static void main(String[] args ){
      File Bird = new File("JavaFactoryPatternExample.sounds/bird.WAV");
      PlaySound(Bird);
  }
  
   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>