Original Post
I have been working on a 3D game sound engine for Java which provides a common interface to various 3rd-party sound and codec libraries. I thought I would post here, in case anyone finds it useful. It is free to use in any project, comercial or otherwise, and the sourcecode is included in the following links. My ulterior motive is that I would like to have more people using my sound system and let me know about any bugs they encounter (which will help me make future games I develop using this library more compatible). Sound System Version date: April 12, 2009 http://www.paulscode.com/source/SoundSystem/SoundSystem.zip The core SoundSystem library, independent from any 3rd-party sound or codec libraries. It is stripped down to the bare essentials, and designed to be easily customizable with various sound library and codec pluggins. If memory is a concern (such as in an applet) this may be a good option, because it allows you to choose as many or as few pluggins as you require for your project. NOTE: The core SoundSystem library without any pluggins is only capable of playing MIDI files. Additional pluggins should be added for more capabilities. The source code and license are included in the .zip file. Sound System jPCT Version date: April 12, 2009 http://www.paulscode.com/source/SoundSystem/SoundSystemJPCT.zip The jPCT-friendly 3D sound library. The SoundSystemJPCT class overrides the core SoundSystem libray, and provides a number of methods to make adding 3D sound to any jPCT project easy. It includeds methods for binding Listener to Camera and Sources to Object3Ds, as well as using SimpleVector parameters. SoundSystemJPCT utilizes the LWJGL binding of OpenAL (with JavaSound as a backup option), and the J-Ogg library for .ogg support. NOTE: The core SoundSystem library, source code, and all relevant licenses are included in the .zip file. Pluggins: JavaSound library pluggin Version date: April 12, 2009 http://www.paulscode.com/source/SoundSystem/LibraryJavaSound.zip Interface to the Java Sound API. More compatable than OpenAL, but not as high quality and fewer features. This pluggin utilizes JavaSound's panning and volume control methods to simulate an reasonable-quality 3D sound system. Known bug: quickPlaying sounds will begin playing them at full volume for a split second, before switching to the correct volume. This is a bug with the Java Sound API itself, and therefore beyond my control to correct. An easy workaround is to add 0.02 seconds of silence to the beginning of each sound effect (the free Audacity sound editor works well for this). LWJGL OpenAL library pluggin, Version date: April 12, 2009 http://www.paulscode.com/source/SoundSystem/LibraryLWJGLOpenAL.zip Interface to the LWJGL binding of OpenAL. The LWJGL library (http://www.lwjgl.org) is required for this pluggin to work. This library sounds much better than Java Sound, but is not as compatable. I recommend using the JavaSound library pluggin as a backup option. NOTE: Please read the included LWJGL license. JOAL library pluggin, Version date: April 12, 2009 http://www.paulscode.com/source/SoundSystem/LibraryJOAL.zip Interface to the JOAL binding of OpenAL. The JOAL library (https://joal.dev.java.net/) is required for this pluggin to work. As mentioned previously, this library sounds much better than Java Sound, but is not as compatable. I recommend using the JavaSound library pluggin as a backup option. NOTE: Please read the included JOAL license. WAV codec pluggin, Version date: April 9, 2009 http://www.paulscode.com/source/SoundSystem/CodecWav.zip Adds support for .wav files. JOgg codec pluggin, Version date: April 9, 2009 http://www.paulscode.com/source/SoundSystem/CodecJOgg.zip Adds support for .ogg files using the J-Ogg library. This codec is less compatible than the JOrbis codec, but the license is less restrictive. Sometimes running incompatable .ogg files through a converter will make them compatable. NOTE: Please read the included JOgg license. JOrbis codec pluggin, Version date: April 9, 2009 http://www.paulscode.com/source/SoundSystem/CodecJOrbis.zip Adds support for .ogg files using the JOrbis library. More compatible than the JOgg codec, but reads data more slowly. It may not be possible to play more than one stream simultaneously (things like background-music, streaming speech, etc) when using this codec (normal non-streaming sound effects are not affected by this limitation). This pluggin is licensed by the LGPL. NOTE: Please read the included LGPL document. Documentation: JavaDoc, Version date: April 12, 2009 http://www.paulscode.com/docs/SoundSystem/ Also includes the JavaDocs for SoundSystemJPCT and all library and codec pluggins. 3D Sound with SoundSystem, PDF http://www.paulscode.com/tutorials/SoundSystem/SoundSystem.pdf Example programs http://www.paulscode.com/tutorials/SoundSystem/SoundSystemTutorialsSource.zip A tutorial-style guide to using the core SoundSystem library (last updated: March 29, 2009). Demos: Sound Effects Player http://www.paulscode.com/demos/SoundSystem/30MAR2009/SoundSystemPlayerApplet.html Source Code http://www.paulscode.com/demos/SoundSystem/30MAR2009/SoundSystemPlayerAppletSource.zip Demonstrates library switching on the fly, streaming background music, playing MIDI, and playing multiple sources simultaneously. What's new? - Added a new library pluggin for JOAL. - Fixed a class-name mistype in error messages logged by library pluggins. - Fixed a potential logic error in the LibraryLWJGLOpenAL class channel-initialization code. [Edited by - paulscode on April 13, 2009 10:12:21 PM]