title: How can i reload a wav file using openAL (java)
body: <p>I made up an application which loads a .wav file, but it loads it only once.
  I want to be able to reload a wav file after the first track ends.How can i make that in java?
  Also, if i hit play twice after the end of the track(while the selected track is loaded) it throws an </p>
  
  <pre><code>IllegalThreadStateException.
   if (threadStatus != 0 || this != me)
              throw new IllegalThreadStateException();
  </code></pre>
  
  <p>the code i use to load the file is this:</p>
  
  <pre><code>OpenAL openal = new OpenAL();
  
  
  
  source = openal.createSource(new File(Audioplayer.path));
  System.out.println(source.toString());
  source.play();
  source.setGain(0.75f);      // 75% volume
  source.setPitch(0.85f);     // 85% of the original pitch
  source.setPosition(0, 0, 0); // -1 means 1 unit to the left
  source.setLooping(false);    // Loop the sound effect
  j=source.getBuffer();
  System.out.println(j);
  for (i=1;i&lt;=10000;i++){
      Thread.sleep(1);        // Wait for 10 seconds
  }
  Thread.sleep(10000);        // Wait for 10 seconds
  source.close();
  openal.close();
  </code></pre>