Seems I’m a late poster in this thread, but I stumbled onto the same issue myself. I did some research, and I believe I may have found a bug in how the AppSettings’ AudioRenderer value is handled.
I’ve based my application on the SimpleApplication class, and I got the same “Could not locate OpenAL library” message while using a computer without a sound card driver. After reading this thread, I tried OP’s approach by creating my own AppSettings and setting its AudoRenderer value to null:
public static void main(String[] args){
AppSettings settings = new AppSettings(true);
settings.setAudioRenderer(null);
MyGame app = new MyGame();
app.setSettings(settings);
app.start();
}
As OP, I still got the same result as before. The code inside the initAudio() method mentioned by pspeed would still run, causing exceptions.
After a little debugging, I noticed that AudoRenderer’s value in AppSettings had reverted back to “LWJGL” and was no longer null when initAudio() was invoked. This was a bit strange, since I was sure I set it to null in the main() method. A bit more research, and I noticed that the AudioRenderer value got changed back to “LWJGL” when SimpleApplication.start() was invoked.
I checked the JME documentation to make sure I wasn’t using AppSettings in an unintentional way, but according to the information found at https://jmonkeyengine.github.io/wiki/jme3/intermediate/appsettings.html, OP’s approach is correct, and I assume this is how it’s intended to work.
This seems to be an issue exclusively with the AudioRenderer. I haven’t tested all settings, but the FrameRate setting, for instance, doesn’t get overwritten, and works just fine. I was able to work around the issue by setting the AudioRenderer to null on both the SimpleApplication and its context after invoking app.start(), but this feels like a hack.
I’m running JME version 3.2-stable on 64-bit linux.