title: Invalid format with getAudioInputStream, trying to play a sound in Java
body: <p>I'm trying to just play a basic sound in Java...</p>
  
  <p>Here is my code, based on the code found on various forums :</p>
  
  <pre><code>    Clip clip = null;
  
      try {
          clip = AudioSystem.getClip();
          AudioInputStream inputStream = AudioSystem.getAudioInputStream(new File(url));
          clip.open(inputStream);
      } catch (LineUnavailableException | IOException | UnsupportedAudioFileException ex) {
          Logger.getLogger(Pomodoro.class.getName()).log(Level.SEVERE, null, ex);
      }
  
      return clip;
  </code></pre>
  
  <p>I checked that : <code>new File(url).exists();</code> returns true, I checked that the file type is really audio WAV (audio/x-wav), I checked that the problem persists with another file... I don't understand what I'm doing wrong.</p>
  
  <p>The error :</p>
  
  <pre><code>Exception in thread "main" java.lang.ExceptionInInitializerError
  Caused by: java.lang.IllegalArgumentException: Invalid format
      at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.createStream(PulseAudioDataLine.java:142)
      at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.open(PulseAudioDataLine.java:99)
      at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.open(PulseAudioDataLine.java:283)
      at org.classpath.icedtea.pulseaudio.PulseAudioClip.open(PulseAudioClip.java:402)
      at org.classpath.icedtea.pulseaudio.PulseAudioClip.open(PulseAudioClip.java:453)
  </code></pre>
  
  <p>Help !</p>