Ok, the title may not be exactly correct, but here is what I mean by that: I have a class with a method that looks like this:
package chess;
import java.io.*;
import sun.audio.*;
public class SoundPlayer
{
public static void Play(String AudioFile)
throws Exception
{
// open the sound file as a Java input stream
InputStream in = new FileInputStream(AudioFile);
// create an audiostream from the inputstream
AudioStream audioStream = new AudioStream(in);
// play the audio clip with the audioplayer class
AudioPlayer.player.start(audioStream);
}
}
What I want to do, is to compile a .wav file inside the .jar along all the .java files, and be able to play it with this method. To do this on batch, all I had to do was type the file name, and it used the current directory. I tried that here and it didn't work. So, my final question:
What do I need to type before "/sound.wav" to have my program reffer to it from the source directory? Sorry if I didn't make it clear. I have searched around, but I guess I didn't know what exactly to search for on google, because I didn't find any explanation.