Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding directory to classpath in IntelliJ 12
    primarykey
    data
    text
    <p>I know this has been addressed before <a href="https://stackoverflow.com/questions/854264/how-to-add-directory-to-classpath-in-an-application-run-profile-in-intellij-idea">here</a> but this solution doesn't work for me, and I don't know why. </p> <p>I follow the given steps, but at 5 there is no dialog that comes up. I am trying to add mp3plugin.jar to my dependencies, but after following this process, I still get an UnsupportedAudioFileException at runtime. </p> <p>What am I doing wrong?</p> <p>Here is a screencast of what I am doing: <a href="http://www.screenr.com/G70H" rel="nofollow noreferrer">http://www.screenr.com/G70H</a></p> <p>Here is the code that uses the audio file:</p> <pre><code>import javax.sound.sampled.*; import java.io.File; import java.io.IOException; public class Sound { private Clip clip; public Sound (String in){ try{ File file = new File ("src/music/" + in + ".mp3"); //System.out.println(file.getAbsolutePath()); clip = AudioSystem.getClip(); AudioInputStream inputStream = AudioSystem.getAudioInputStream(file); clip.open(inputStream); } catch (IOException e){ e.printStackTrace(); } catch (LineUnavailableException e){ e.printStackTrace(); } catch (UnsupportedAudioFileException e){ e.printStackTrace(); } } public void stop(){ clip.stop(); } public void loop(){ if (!clip.isActive()){ clip.setFramePosition(0); clip.loop(Clip.LOOP_CONTINUOUSLY); } else { System.out.println("already playing.."); } } } </code></pre> <p>And in this runs it:</p> <pre><code>Sound sound = new Sound (in.readLine()); //from a bufferedreader sound.loop(); </code></pre> <p>I know this works because it works with .wav files.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload