CAS; How do you use ogg with LWJGL?

I read somewhere that you’ve created a sound package that plays ogg files and that you’re using it in Alien Flux, any source available yet?

I’ made a OggInputStream and OggPlayer that can be used stream or decompress ogg files.

There you go :slight_smile: And the source always was available in CVS of SPGL: http://www.sourceforge.net/projects/spgl (in com.shavenpuppy.jglib.sound.*)

Cas :slight_smile:

Cool That stuff is usefull…

Any good mp3 - > Ogg converters out there

I used CDEx 1.5 to reconvert mp3s into oggs. The quality is “as expected”.

Cas :slight_smile:

princep how it is with spgl… Can I take single files or do I need to use the whole jar. I just would like to use your ogg to wave converter.

Btw saw your soundmanager. it uses priorities for removing sounds (if there are too many).

My idea was to remove the sound the furthest away from listener (must be the one thats hardest to notice).

There’s no jar, just grab it from CVS. Better still just look at the example code that comes with Jorbis, which is where I copied it from.

My priority management system is pretty crude, yes, and could do with some feature to work out the loudness of a sound at any particular moment. But it works well, and it’s dead easy. Doing it by distance has the pitfall that the distances may be very short indeed and all visible onscreen - if a new visual effect occurs and it’s further away than some other visual effect then the sound will never play and that won’t seem right.

Cas :slight_smile:

Ah well I had another approach… A new sound wanting to be played always has highest priority. If all sources are occupied I must free one, and that will be the one furthest away.

This leaves a risk for having background music messed up. So I am going to make a special case for that one (it is isnt it :slight_smile: )

Caspian… I made the ogg converter work and yes it was much easiere to grab if from jorbis.

But I observed this. When I link the newly created wave file I created from a ogg to an object positions and move that object futher away from my listener, nothing happens.

When I do the same thing with any of my wave files it works fine. The sound shifts from speaker to speaker according to position.

Have you observed this behaviour at all?. Is it linked the the ogg files at all… perhaps its linked to the sound type eg 16bit stereo etc…

SFX must be mono and music either stereo or mono.

That makes sense… so my converted mp3-> ogg->wave is ofcourse in stereo…

well fine by me its for backgroundSound and engine humming

Btw it’s that way with all sound apis and it has of corse a reason.

Stereo music is a mix down of a lot of (mono) sound sources. Guitar here, vocals there, drums there, bass over there etc.

If you want to place a sound source somewere in 3D space it has to be mono - otherwise you would have to specify alot of weird things like distance from left to right and orientation of that axis. Since that would be highly obscure no one does that. It’s much easier to have two seperate sound sources wich you place accordingly (or just mix em down to mono if they aren’t far away from eachother).