Runnable jar doesn't play WAV formats

I exported runnable jar from my libgdx desktop project.
To my surprise, the jar file doesn’t play most of the WAV formats, it plays only 2 out of 5.

I executed the jar file from the command line to check for errors, but it was perfectly fine, i checked the files, and it looks like bit rate is not the problem.

Any ideas folks?

well we would assume that files are found since 2 are playing, and there are no errors, however fileNotFound would be the goto problem.
next problem could be the format: make sure they all have the same format or at least a format that works. however why that wouldnt work in a jar but from the project itself, I’m not sure

I found the problem, I needed to extract the sound folder from the jar and place it near the jar. now it plays all the sounds.
I really don’t get it, gonna check it in advance.

Sorry didn’t see your reply, well all the files are the exact same format (wav), and they almost all identical. but for some reason only 2 worked, but see my previous comment for the fix.

It’s possible to read and play sound files within a JAR without extracting them, this is what I do in my own game and it works flawlessly.

FYI, just in case you aren’t aware of this, there are a lot of issues pertaining to audio formats besides whether something is a WAV or not. I apologize if I am mentioning something you already know, but the posts you gave allow an ambiguous interpretation.

It can be stereo or mono, and the bytes can be in either little-endian or big-endian order. It can be 16, 24, or 32 bits encoding. And concerning frame rates, I think (I could be wrong) that 44100 is the maximum supported by Java, but some DAWs are now working at 48000 or 96000 fps. If any of these parameters are varying between the samples, then the formats could be an issue.

I think I also had some trouble once when I designated the ‘compression’ option when generating a jar in Eclipse for the resource files. This might make a difference as well, though admittedly WAV files are pretty large if they aren’t compressed, and this might make using some sort of compression (at some stage or another) mandatory.