title: How to import sun.audio?
body: <p>I am attempting to play audio for a program and I need the AudioStream class and the AudioPlayer class, but when I attempt to import them Eclipse gives me an error.</p>
  
  <p>Method where used: </p>
  
  <pre class="lang-java prettyprint-override"><code>public static void playMusic(String filepath) {
  
          InputStream music;
          try {
              music = new FileInputStream(new File(filepath));
              AudioStream audio = new AudioStream(music);
              AudioPlayer.player.start(audio);
          } catch(Exception e) {
              JOptionPane.showMessageDialog(null, "Error"); 
          }
      }
  </code></pre>
  
  <p>Imports: </p>
  
  <pre class="lang-java prettyprint-override"><code>import java.io.File;
  import java.io.FileInputStream;
  import java.io.InputStream;
  import javax.swing.JOptionPane;
  import sun.audio.AudioPlayer;
  import sun.audio.AudioStream;
  </code></pre>