JWS and net.games.sound3d

The current problem that I am encountering is loading files in JWS with the sound3d package. Is there an easy way of doing this? Or do I need to ditch the sound3d package and use the underlying packages (this is not preferable).

I found how to load files using the joal native packages and the code below shows this.


SingleStaticSource.class.getClassLoader().getResourceAsStream("demos/data/FancyPants.wav")

The problem with my code is that I’m using the net.java.games.sound3d package. The only option I have for loading a buffer is to provide a String shown below.


Buffer loadBuffer(String filename)

When this method is used while deployed in JWS, the file is unable to load (even if you call getResouce and convert the URL into a String).

If there isn’t a way to load sound files with sound3d and jws, then how difficult would it be for someone to add this? Could I checkout the source and attempt this - or is the learning curve on working with this code too great to make it worth my time?

Thanks

It would be very good if you would try this out and contribute code. Nobody is really looking at the Sound3D implementation at this point and it was never retrofitted to work well in a Java Web Start environment. If you look at what was done with the JOAL ALut it should be pretty easy (actually, the Sound3D stuff can probably be implemented on top of ALut or the WAVLoader).

Alrighty then :slight_smile:

So I’ve actually checked it out via cvs and modified the code. You were right. This was pretty easy. I have yet to test this via jws; however, I have tested it using the newly joal.jar file that I created!.

I’ve added a method in the AudioSound3D class shown below


public static Buffer loadBuffer(InputStream stream)

Anyways, using the inputStream works fine using the jar. So my question is, how do I try this out using jws? For my game, I’m pointing jws to the download.java.net/media/joal/webstart/joal.jnlp

Also, once this is tested out more thouroughly, am I able to check in changes? How would these changes be applied to the jws delpoyed joal?

Thanks

File a Patch with the Issue Tracker on the JOAL home page and we’ll check it in for you.

You can test your changes by hosting your own copy of joal.jar, the joal native library jars, and a joal.jnlp on your own web server and pointing your extension href to that. Or we can check in the changes (assuming they look OK) and we’ll update the main JNLP.

Sounds good. I’ll send a patch later tonight when I get home.

Alrighty, I posted the patch — Issue #18.

I hope I did this right, let me know otherwise.

Yes, thanks. It’s been checked in.

How long does it take for it to get rolled into the JWS distro?

I have a to-do item to re-push the JWS binaries, and also to incorporate one bug fix to the EFX functions that isn’t quite complete. As soon as our Linux build machine comes back on line (hopefully today) I’ll try to take care of both of these items.

Awesome - sounds good man. Thanks!