Author
Topic: 3D Sound System (Read 194446 times)

I noticed a weird bug in the LibraryJavaSound plug-in today, where if the source and listener have exactly the same position, the source is silent regardless of its intended volume. This is on my PC running Linux and 64-bit Sun Java (a combination which has a multitude of other problems), so I'll verify that this is happening on "normal" computers as well when I get home this evening (if anyone wants to test this for me, try playing a source from position 0,0,0 without moving the listener, and see if you hear anything).

I've verified that this is a 64-bit Sun Java Linux thing (works fine in other OSs and JREs). It is really odd - everything indicates that the source is playing, but no sound. I think maybe I'll play around with the gain controls next (maybe it's assuming incorrectly that a gain of "0" is silent instead of initial gain).

Sounds like (no pun intended) that coding sound for Linux is quite a bucket of joy.

There were two small issues with 32-bit Java, which I have addressed (the webcam bug and the lack of a default JavaSound Mixer for non-Sun Java versions like OpenJDK), but it's mainly just 64-bit Sun Java for Linux that's a total piece of crap (which is why Ubuntu for example ships with OpenJDK instead).

Figured it out...I had a directory called paulscode with old SoundSystem sources on the same level as src as backup. It wasn't marked as source folder nor was it part of the classpath but somehow, Eclipse figured out that it should be used instead of the sources located in the actual src-folder...no idea why, but deleting it helped. After figuring out that i now have to add libraries and codecs (haven't updated the SoundSystem for ages...), sound is back again...

After figuring out that i now have to add libraries and codecs (haven't updated the SoundSystem for ages...), sound is back again...

Yes, the library has started becoming a bit bloated I think (although considerably more compatible than it was before). I've stopped adding new features, and just plan to make bug-fixes and optimizations when needed. I do have a new update I should get out at some point, though, which reduces the delay that used to happen when transitioning between music streams. I'll try and get the code cleaned up and post it this weekend.

BTW, I am working on an Android version which utilizes a native mixer I wrote (requires the NDK of course). The API is virtually the same, so it should make porting desktop jPCT games to Android a bit easier from an audio standpoint. I haven't had a lot of time for programming lately, but hopefully I'll be able to get it out in the coming weeks.

Error in class 'LibraryLWJGLOpenAL' Unable to open file 'sound/fx/scraping-ice-1.wav' in method 'loadSound'Error in class 'LibraryLWJGLOpenAL' Sound buffer was not created for sound/fx/scraping-ice-1.wavError in class 'LibraryLWJGLOpenAL' Source 'Source_-967832717_1724366595' not found in method 'play'

That is what I get if i just initilize the SoundSystemJPCT and then try to play the sound.

If I try to initialize the SoundSystemJPCT using the SoundSystemLoader I get this error when trying to play the file:

Exception in thread "main" java.lang.NullPointerExceptionError in class 'LibraryLWJGLOpenAL' Unable to open file 'scraping-ice-1.wav' in method 'loadSound' at paulscode.sound.SoundSystemJPCT.quickPlay(SoundSystemJPCT.java:1591) at paulscode.sound.SoundSystemJPCT.quickPlay(SoundSystemJPCT.java:1542) at paulscode.sound.SoundSystemJPCT.quickPlay(SoundSystemJPCT.java:1520) at paulscode.sound.SoundSystemJPCT.quickPlay(SoundSystemJPCT.java:1377) at game.sound.SoundSystem.main(SoundSystem.java:45)

which seems to be a nullpointer at some randomNumberGenerator. How can I fix these problems??

Hello what does this mean?... Unable to open file 'sound/fx/scraping-ice-1.wav' in method 'loadSound'... Unable to open file 'scraping-ice-1.wav' in method 'loadSound'

This means it was unable to open the file. Most likely cause is the name of the file or the folder path are misspelled. Note that it is case sensitive (i.e. "sound" vs. "Sound"), and be sure to check if there is a missing "s" (i.e. "sound" vs. "sounds").

If you are sure the path and file names are correct, the next thing to check is if you compiled the file into the JAR (passing a name like "sound/fx/whatever.wav" will look inside the JAR for the file, not in the external containing folder).

If neither of those are the problem, please post your initialization code (any SoundSystemConfig settings and plug-ins), or the HTML file you are using for the loader.