TestSoundGraph (openal,xp)

Get the following error when it tries to load sample…



Edit: If it matters I’m using jdk 1.5.0_03



java.lang.NullPointerException
at com.jmex.sound.openAL.objects.Sample3D.<init>(Sample3D.java:47)
at com.jmex.sound.openAL.objects.Sample3D.<init>(Sample3D.java:58)
at com.jmex.sound.openAL.SoundSystem.create3DSample(SoundSystem.java:224)
at jmetest.sound.openal.TestSoundGraph.simpleInitGame(TestSoundGraph.java:115)
at com.jme.app.SimpleGame.initGame(SimpleGame.java:342)
at com.jme.app.BaseGame.start(BaseGame.java:63)
at jmetest.sound.openal.TestSoundGraph.main(TestSoundGraph.java:74)

there is an "external"/another data folder in jme where those sounds are located entering the jme project folder as a classpath variable fixed that for me

Hi mcbeth. Could you be more specific? I have tried entering the full project path (parent to “data”) in the VM arguments, eg,



-Djava.library.path=lib/;C:/std/dev/eclipse/workspace/jme/;



…and various combo’s but still the same error.



Thanks.

the sound files that that test uses exist in jme/data and java cant find them, jme being the base project folder, you can add the jme project folder to your classpath so that it can locate that folder.



in other words jme has two data folders jmetest/data and jme/data the latter being the one you want.



you add that to your classpath like you did with the project jars.

hmmm… still no good Maybe it’s an Eclipse thing.



When I added the project jars, by right-clicking on the top-most jme “project” icon, there is only the option to add a class folder, not a classpath folder. I have just about exhausted all the combo’s for this and the vm arguments. Anyone else have any ideas? So close and yet so far :x

Try to find out what the app really want to load ie. if it tries to read something like: “/xxx/iwantthis.ogg” then You have to mount the directory that is before the first slash into Your classpath ( -cp c:/aaa/bbb ) where bbb is the dir above xxx



If this doesn’t work then maybe You can give some code?

"dmoc" wrote:
there is only the option to add a class folder,

try that, if it fails try running from run option menu and add jme/ as an advanced option in the classpath tab under user entry

look at the source it needs two ogg files program needs those two files and cant find them because that are outside the src directory and are thus not included in the build so you need to specific where they are.

hope that helps

Starting to get somewhere. Tried the fsound version, problem here was no dll. Back to the openal version, added "/jmetest" to the front of the two file references. Also added (external) lib jmetest-data.jar to the project. Turns out "test.ogg" is included in the jar but "CHAR_CRE_1.ogg" is not. Not sure if I am following all this correctly but here goes: there is the data dir under src/jmetest and also a "data" directory under jme dir. In the case of TestSoundGraph (openal) one data dir contains one file while the other file is in the other data dir So I get an error no matter what I do!!! What’s happening? Should I move all the data files to src/jmetest/data so that the jar (with full contents) can be referenced? And then get rid of the jme/data dir to avoid confusion?



Also, the original file paths, ie, without "/jmetest" should refer to absolute path… but is this relative to the classpath or really absolute? Alternatively what would be the "modified_package_name" mentioned below?



Final Q: why the different approach between the fmod and openal versions?





URL java.lang.Class.getResource(String name)

Finds a resource with a given name. The rules for searching resources associated with a given class
are implemented by the defining { of the class. This method delegates to this object's class loader.
If this object was loaded by the bootstrap class loader, the method delegates to ClassLoader.
getSystemResource.
Before delegation, an absolute resource name is constructed from the given resource name using
this algorithm:
- If the name begins with a '/' ('u002f'), then the absolute name of the resource is the
portion of the name following the '/'.
- Otherwise, the absolute name is of the following form:
modified_package_name/name

Where the modified_package_name is the package name of this object with '/' substituted for '.'
('u002e').
Parameters:
name name of the desired resource
Returns:
A {@link java.net.URL} object or null if no resource with this name is found
@since
JDK1.1
[/quote]

bump + in HelloIntersection the sound file paths are hard coded and when I shorten them to "data/sound/…" only the ogg is loaded.

I just had the same problem.

Changed the relevant lines to



footsteps = SoundSystem.create3DSample(TestSoundGraph.class.getClassLoader().getResource(“jmetest/data/sound/CHAR_CRE_1.ogg”));

background =SoundSystem.create3DSample(TestSoundGraph.class.getClassLoader().getResource(“jmetest/data/sound/test.ogg”));





and made sure the CHAR_CRE_1.ogg file was in the jmetest/data directory



Can someone PLEASE update the CVS so this is correct?

Frustrating when the basic demo’s don’t run.

Done.

ty