file not played after packaging to jar

i have a problem in playing sound after packaging my game to jars. a couple of sound are not played, and others are not played properly.

but if i'm playing the game using the classes only (not packaged to jar) everything is fine.

any of you guys had any idea how can this happening?

[302 byte] By [adeanoma] at [2007-10-1 22:54:59]
# 1
sorry the subject should be "Sound file not played after packaging to jar".i didn't find the edit button to edit my post here.... :)
adeanoma at 2007-7-15 13:54:18 > top of Java-index,Other Topics,Java Game Development...
# 2
You are probably trying to access your sound files as actual files (using FileInputStreams or whatever). When they are inside jars, you can't do that. You have to call getClassLoader().getResource("path/to/your/soundfile.wav"); to get an InputStream to your sound file.
Herko_ter_Horsta at 2007-7-15 13:54:18 > top of Java-index,Other Topics,Java Game Development...
# 3
> sorry the subject should be "Sound file not played> after packaging to jar".> > i didn't find the edit button to edit my post> here.... :)There is no edit button...Are you getting an exception? Post the stack trace if you are.
macrules2a at 2007-7-15 13:54:18 > top of Java-index,Other Topics,Java Game Development...
# 4

i already used getClassLoader().getResourceAsStream("path/to/file.wav");

but it is only happen to my wav file, the midi file still playing right even though both are loaded the same way using getClassLoader().

and i don't get any Exception at all. I don't know if it mean that the sound is playing but the volume is in mute but that give me another confusion since i haven't implement the volume changer.

adeanoma at 2007-7-15 13:54:18 > top of Java-index,Other Topics,Java Game Development...