Hi,
I'm working on my sound framework,
and I try to generate as many sound sources as possible with a maximum number of 32 (actually it will try to generate more sources if it runs out of sources and playing a sound is requested).
Problem is, alGenSources throws an OpenALException:
Exception in thread "main" org.lwjgl.openal.OpenALException: OpenAL error: Invalid Value (40963)
at org.lwjgl.openal.Util.checkALError(Util.java:56)
at org.lwjgl.openal.AL10.alGenSources(AL10.java:719)
at com.chickensoft.sound.SoundSystem.init(SoundSystem.java:108)
at com.chickensoft.starcruiserclassic.StarcruiserClassic.init(StarcruiserClassic.java:376)
at com.chickensoft.starcruiserclassic.StarcruiserClassic.<init>(StarcruiserClassic.java:123)
at com.chickensoft.starcruiserclassic.StarcruiserClassic.main(StarcruiserClassic.java:186)
I think this happens because I try to generate too many sources(my sound card should be able to handle 128, but for some reason it won't generate more than 30), but I never get to my alGetError check, which is supposed to break out of the loop and stop generating sources.
I guess I could simply catch the exception and break out of the loop if it catches an OpenALException, same as what would happen if I did an alGetError check.
Basically I'm doing the exact same thing as in the Advanced Loading and Error Handles tutorial, except I try to generate as many sources as possible, and play whatever sound is requested to play on the first available source, instead of binding sounds to sources.
Not sure if this has changed in the 1.0 beta (2), as I'm still using .99.
Another minor thing, loading au files with WaveData gives some pretty weird distortion, I guess au isn't a supported format, but shouldn't create jsimply return null if it isn't?
I'm not going to use au sounds, but I just had an old au, that I wanted to use for testing, and it sounded kind of weird (not sure what it's called in English, but I think the wave gets cut at some point, and I end up with a square wave instead of a sawtooth or triangle wave which I think the sound currently is)..