Access files (.wav) in java package
- by Highmastdon
I want to access my .wav files which are in a package inside my project.
For example I got two packages:
package program
package sounds
From inside the program/something.class I'd like to play the sounds/asound.wav.
How is this possible.
clip.open(AudioSystem.getAudioInputStream(new File(filename)));
clip.start();
//.... something inbetween
clip.stop();
Here filename is C:\\projects\\something\\sounds\\, but how is it possible to just give a relative path to the asound.wav in the package?