Mads: The problem with wav files is that they are do damn big! For instance, the resources used in my game is about 300 mb. The music files, all wavs, make up to 80% of the files size. Each song is about 40-50 mb. Converting it to a mp3 would shrink the file size down to 3-5mb. Thats a big difference!

So in the end, its all about space and download time. People are lazy/have slow connections and dont want to download a unknown game that is 300+mb. So using mp3 files instead of wav for music is a must for me.

I agree with Mads. Why not using ogg instead? You won't have any problem of licensing, no fee to pay, it is more widely supported by Java (look at Jogg, Jorbis and Paul Lamb Sound Library), ogg files are smaller than wav files.

Yes, mp3 is patented(in the US until 2017). In the case that you use the oracle implementation(JavaFX) Oracle will have paid the license fee for you I guess.

Also the quality of ogg is better than the one of mp3, i.e. id-Software uses it for its games. The best codec would be opus atm, but because of its young age you won't find that many Java wrappers/implementations.

The reason I said ogg was bad is because the only times I have tried it was when I had converted a mp3 to an ogg, which is a bad idea. The quality loss is huge.Most of my music files have been converted to wav from a mp3 file. So they are fake wavs. Converting these fake wavs to ogg will result in quality loss as well. High quality ogg can be archived by converting true wav files into ogg.

Converting from one lossy format to another is basically like replacing a your ruined tire with a ruined spare tire.

Your quality loss is as bad as going from a lossless to lossy, except it's a lossy to a lossy, which means if you lose say 30% of your quality from lossless -> lossy, then you'd lose another 30% of the lossy, and you'd end up with only 49% initial quality, basically half artifact, half actual sound.

to quote some random guy in a forum that I found on google "When an already lossy audio format such as MP3 is transcoded to another lossy format such as AAC (or even to the same format) then there is an additional level of lossy data compression applied during the conversion. This is called generational loss and it results in further audio quality degradation. The more it's done the worse it gets."

That's basically the best way to explain the problem with lossy to lossy conversion.

I found an excellent way of "converting" a mp3 to ogg without any quality loss. You can record sound output with Audacity and export the sound to an ogg. So I play the mp3 file in winamp or any other player, record the sound, export it to an ogg and done

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org