I want to create a jar with wav files on it so I can play them as resources.
While running Eclipse, I first declare the folder locally like this:
File folderStimuli= new File("C:\\Users\\Martin\\Stimulus");
public void play(File file) throws UnsupportedAudioFileException, IOException, LineUnavailableException{
if (status != PLAYING) {
clip = AudioSystem.getClip();
AudioInputStream ais = AudioSystem.getAudioInputStream(file);
clip.open(ais);
clip.addLineListener(this.lineListener);
status = PLAYING;
this.timeStart=System.currentTimeMillis();
clip.start();
}
}
I now have my files on the project folder, namely, /src/main/resources and want to create a jar that reads the files from there. As a beginner, I don't have a clue how to do it. Would you please be so kind indicating what do I have to change here in order to work?
thank you really much!
Martin