Soundly is a small library in development which extends slick-util's sound functionality.
Primary aims:
- Further control over individual OpenAL sources.
- Further control over the OpenAL listener: its position, orientation, etc.
- Management of OpenAL sources based on priority, distance from listener, etc.
Why manage sources?
When you play a sound with OpenAL (i.e. with Slick2D or LWJGL), the sound relies on a "source". Depending on the machine and platform, you are often limited to work with a low number of sources. (The iPhone, for example, generally supports 32 sources with OpenAL -- i.e. 32 simultaneous sounds.)
With a flurry of gunshots, musical elements, voice-overs, footsteps, environment sounds, etc. it's easy to start racking up the sources. And when we reach this limit (Slick2D defaults to 64 sources), there are no more sound that can be played -- at least not until some of the action dies down!
In most games, by the time we have that many sources playing at once, the user won't notice if we remove some of the superfluous sounds (e.g. bird chirps, footstep) to make way for something that might be more important (another gunshot, a speech element, etc).
In comes Soundly. You define the importance of a Sound and let the sound manager handle the rest -- sounds will be swapped out based on priority, distance from listener, etc.
(Note: Soundly is in VERY early stages, and is subject to change.)
Links
Home page:
http://code.google.com/p/slick-soundly/Source:
http://slick-soundly.googlecode.com/svn ... undly/src/Documentation:
http://code.google.com/p/slick-soundly/w/listEDIT: Updated, completely refactored, removed superfluous interfaces, added "Mix" class for easy mixing of volumes/panning/etc., added the ability of groups within groups
EDIT2: This project is being put on hold for the time being.