Looking for a 2D sound framework

I am looking for a 2D sound framework for java that can do the following:

  • Load wav files.
  • Loop sounds, and also possible of setting the looping point(i e where to start when it have ended, for stage music for example).
  • Play sounds at a position. For example, if me, the main character is at point 200, 300, and a sound is played at point 6000, 4300, the sound wont be heard(mute) because its to far away, out of range, kinda like real life.


You can use Paul Lamb Sound System. It is quite simple to use both for 2D and 3D, it supports several audio file format including WAV and OGG, it handles spatial sound, it has several backends including one based on JavaSound (in case you don’t want to use another third party library), another one based on JOAL (more reliable but you need to deploy GlueGen and JOAL) and a last one based on another Java binding for the OpenAL library.

TinySound might handle panning, I can’t recall for sure. But you would have to compute the volume rolloff and exact pan values yourself. Same with my own audio engine. I think TinySound has a normal sort of clip-looping function.

Has Paul Lamb implemented a filter-rolloff for distance effects? The quick and dirty way is to just lower the volume for distance, but progressive use of a low-pass filter can enhance the effect.

There are links at the JGO resources page.

Yes, Paul Lamb Sound System supports a fading distance or a rolloff factor with different attenuation models.