I spent like 2 hrs on trying to understand the JOrbisPlayer.java and still dont know how i can implement all that stuff in my game so that it can play .ogg files.Does anyone have an example of a game that uses it?

I've tried several of the freewares I've found using "free mp3 to ogg" google search, but they all basically suck. One converted my mp3 song into some 2x speed audio file, and after I used another converter then Jogg could not read it (not a valid ogg file).

None. Converting from one lossy format to another is futile. Well, of course it can be done, but the artifacts introduced by mp3 compression are harder to compress than the original. So, basically you lose some quality for things you don't actually want.

The proper way to do it is to compress the original (lossless) data again. It's pretty easy with OggDropXPd for example. The Foobar audio player is also an option - you can convert all kinds of source material to Ogg Vorbis via rmb->convert.

Oh and don't use the bitrate control stuff. Use the quality setting instead. The -1 setting works for most game related stuff very well. A 35 second mono BGM loop can get as small as 210kb with q=-1 and it still sounds pretty good.

A big advantage of Ogg Vorbis is the subjective good quality at low bitrates. It only sounds a bit damped whereas mp3 starts to create painful "edges" (eg high hats are pretty annoying with mp3 artifacts ).

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