Playing Ogg's without OpenAL

A fellow coder is trying to get a Java 2D based game out. However, they'd like to be able to compress their background music down into OGG files. How do you play OGG files with Java Sound? Well, I say, you just go and pick up JOrbis and JOgg and play it through that (I've done the same thing using OpenAL).

He does that, but it turns out the examples from JOrbis and pretty intricate and don't make alot of useful sense. Especially given in the pure java world we're used to doing simple thing like:

Clip clip = new Clip("mysound.wav");
clip.loop();

Or code to that effect (been a while). Anyway, I offered to wrap JOrbis up to be a bit easier to use, so here it is.. EasyOGG. A sample would be:

OggClip clip = new OggClip("mymusic.ogg");
clip.loop();

Which will load the mymusic.ogg from your classpath and loop it over and over through a Java Sound output. It'll also handle random input streams for those that still believe direct file access is the right way to go.

EDIT: EasyOgg got an update. The new version (0.2) is here

EDIT: EasyOgg got another update. The new version (0.3) is here

EDIT: EasyOgg got another update. The new version (0.4) is here

EDIT: EasyOgg got another update. The new version (0.5) is here

EDIT: EasyOgg got another update. The new version (0.6) is here

Reply

*
*
The content of this field is kept private and will not be shown publicly.

*

  • Lines and paragraphs break automatically.
Verify comment authorship
Captcha Image: you will need to recognize the text in it.
*
Please type in the letters/numbers that are shown in the image above.