If I change the volume of a sound after it has started playing, then I get this exception:
May 31, 2009 9:39:44 PM class com.jmex.audio.openal.OpenALAudioTrack play()
SEVERE: Exception
org.lwjgl.openal.OpenALException: OpenAL error: Invalid Value (40963)
at org.lwjgl.openal.Util.checkALError(Util.java:64)
at org.lwjgl.openal.AL10.alSourcei(AL10.java:766)
at com.jmex.audio.openal.OpenALMemoryAudioPlayer.play(OpenALMemoryAudioPlayer.java:113)
at com.jmex.audio.AudioTrack.play(AudioTrack.java:119)
I checked and the volume setting is in [0,1]. Not sure what the volume restricted range is as there is no doc in jme about it and I know nothing about openal as I am still trying to catch up with opengl ;) Am I missing a call to some "updateSoundState" or similar method in order to prevent this error? Couldn't find any method like this. For those of you who know about openal, is it even possible to change the volume of a sound while it is playing? If so, what am I forgetting to do here?
The volume is being changed from the opengl thread, which is same thread openal initialized on in StandardGame. I am trying to write a volume level control in my in-game options menu. A lot of games do this and don't have to restart the currently playing music or sounds so I would be surprised if this isn't possible.
please post a little example (SimepleGame) to easily reproduce the problem