Hi!
I have just found a few minutes ago another person who had problems with OpenAL under Microsoft Windows XP when another application uses the sound too, his game crashed. I would like to use JavaSound rather than OpenAL to play some sound effects. Is it already implemented in JME? If not, do you think it would require a lot of time to implement an equivalent sound system that uses JavaSound rather than OpenAL? In TUER, I had some problems when ITunes was used at the same time, I solved it easily by taking care of the availability of a line before using it and with a try/catch if my mixer gives me a line that ITunes is going to take whereas I want to open it now.
I remember there were indeed issues with iTunes and it seems like the latest jME2/LWJGL2 fixes the issue? They switched to software based OpenAL library recently.
Using JavaSound AFAIK wouldn't be possible cause' it doesn't have stuff like 3D sound effects, surround or doppler effect.
Momoko_Fan said:
I remember there were indeed issues with iTunes and it seems like the latest jME2/LWJGL2 fixes the issue? They switched to software based OpenAL library recently.
Using JavaSound AFAIK wouldn't be possible cause' it doesn't have stuff like 3D sound effects, surround or doppler effect.
I don't know doppler effect but it is possible to simulate 3D sound and surround with JavaSound. If the software-based version of OpenAL works reliably, I won't need to use JavaSound. Thank you for your explanation.
But is it possible to deploy only the OpenAL binding of LWJGL as I don't need its OpenGL binding?
Would it be straightforward to use JOAL instead of LWJGL for the sound system of JME 2.0?
gouessej said:
But is it possible to deploy only the OpenAL binding of LWJGL as I don't need its OpenGL binding?
Would it be straightforward to use JOAL instead of LWJGL for the sound system of JME 2.0?
Yeah, you can select to use JOGL as your renderer while OpenAL will be used from lwjgl. If you want to conserve space you can remove all OpenGL stuff from lwjgl.jar.
I am not sure but I don't think jME has a pluggable sound system. If it does, it should be a simple porting job from LWJGL OpenAL to JOAL as long as you can somehow integrate the JOAL object oriented API into the system in the same way the JOGL renderer is made.
Momoko_Fan said:
gouessej said:
But is it possible to deploy only the OpenAL binding of LWJGL as I don't need its OpenGL binding?
Would it be straightforward to use JOAL instead of LWJGL for the sound system of JME 2.0?
Yeah, you can select to use JOGL as your renderer while OpenAL will be used from lwjgl. If you want to conserve space you can remove all OpenGL stuff from lwjgl.jar.
I am not sure but I don't think jME has a pluggable sound system. If it does, it should be a simple porting job from LWJGL OpenAL to JOAL as long as you can somehow integrate the JOAL object oriented API into the system in the same way the JOGL renderer is made.
Thank you for your quick reply. I think I will add this task into my to-do list. As you know, I have complained about a few annoying bugs under Linux in LWJGL, I want to avoid to use it (and JOGL 2.0 should work on Android whereas LWJGL does not). Refusing the use of LWJGL for OpenGL but using it for OpenAL would not be logical...
Do you know how I could force JOAL to use openal-soft instead of any buggy hardware implementation?
Are there only dependencies with OpenAL in com.jmex.audio.openal?
Do you know how I could force JOAL to use openal-soft instead of any buggy hardware implementation?
I have no idea how JOAL works, but I assume they include an OpenAL native library with their distribution, in which case you can just replace it with the software OpenAL library.
Are there only dependencies with OpenAL in com.jmex.audio.openal?
A quick check shows that the audio system in jME was also meant to be pluggable just like the renderer is, but the default OpenAL implementation is created by default:
/**
* Singleton access to the audio system. FIXME: Currently hardcoded to
* create an openal system.
*
* @return the singleton audio system
*/
public static synchronized AudioSystem getSystem() {
if (system == null)
system = new OpenALSystem();
return system;
}
Other than that, there are no references to OpenAL.
Sorry to answer your post so late, but I had trouble creating an account with jMonkey (never got the confirmation email, and it wouldn’t resend either so I had to create a different acount). Anyway, it is possible to create a 3D sound system based on JavaSound. I did it in my 3D Sound System JavaSound Library plug-in by using the volume and pan controls that are available for both Clip and SourceDataLine instances. The sourecode for the plug-in is available on that thread, so feel free to take a look and copy/paste whatever you need.
PaulLamb said:
Sorry to answer your post so late, but I had trouble creating an account with jMonkey (never got the confirmation email, and it wouldn't resend either so I had to create a different acount). Anyway, it is possible to create a 3D sound system based on JavaSound. I did it in my 3D Sound System JavaSound Library plug-in by using the volume and pan controls that are available for both Clip and SourceDataLine instances. The sourecode for the plug-in is available on that thread, so feel free to take a look and copy/paste whatever you need.
Does it solve some latency problems? Is it easy to integrate your plugin inside JME?
gouessej said:
Does it solve some latency problems?
I don't know how the latency of my library compares with that of JME, although there is no noticable delay on my computer, and no-one else has mentioned a delay problem to me yet (This is one reason I would like to get some other people using my library so I can see how well it performs on a variety of systems).
gouessej said:
Is it easy to integrate your plugin inside JME?
Actually, I was just suggesting that you could copy the plug-in's source code as a reference for doing 3D sound in JavaSound. The pluggin by itself is not designed to integrate into JME. It was designed for my core SoundSystem library, so to integrate it stand-alone into JME would take some significant re-working of the code. On the other hand, integrating the actual SoundSystem library (along with the plug-in) into a JME project would be quite simple to do (it is considerably higher-level to use than say the OpenAL library by itself).
Did you test under Linux and Mac?
gouessej said:I have tested it under several Linux systems. A number of Linux systems seem to have a problem with OpenAL (as I'm sure you are aware), in which case JavaSound always worked as a fallback option. I have not run any comprehensive tests on Mac (I don't have a test machine with Mac, and couldn't find any dedicated users running Mac to help me beta-test). However, I have written a few test-programs for various pieces of the library during its development, and some of those tests were run on Mac systems with no problems reported.
Did you test under Linux and Mac?