Ok now this is a real problem I believe. When I run this in eclipse it works fine, but once I export it to a jar the sound refuses to work. I have the 3 .wav files in a resources folder and I have a button that toggles the String 'file' between them.
Relevant code:
private class AudioClip extends Thread implements ActionListener{ //private InputStream in; private AudioStream as; public void run(){ //Open audio stream try{ //in = this.getClass().getResourceAsStream("/resources/" + file); //as = new AudioStream(in); as = new AudioStream(this.getClass().getResourceAsStream("/resources/" + file)); AudioPlayer.player.start(as); Timer time = new Timer(5000, this); time.setRepeats(false); time.start(); }catch(FileNotFoundException e){ e.printStackTrace(); }catch (IOException e){ e.printStackTrace(); } } public void actionPerformed(ActionEvent event) { AudioPlayer.player.stop(as); } }