Requested changes to the jME sound library

To allow sounds to be moved after the initially playing them: in com.jmex.sound.openAL.objects.Sample3D:

the method setPosition changed to:

public void setPosition(float x, float y, float z){
        position.clear();
        position.put(x);
        position.put(y);
        position.put(z);
        //positionChanged=true;
       if(sourceNumber>=0){
                AL10.alSource3f(sourceNumber, AL10.AL_POSITION, position.get(0), position.get(1), position.get(2));
            }
    }



And in com.jmex.sound.openAL.objects.util.SampleLoader loadOgg() (NOT loadWav()) for the following to be commented out:

if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN)
            {
                ShortBuffer tmp2 = data.duplicate().order(ByteOrder.LITTLE_ENDIAN).asShortBuffer();
                while(tmp2.hasRemaining())
                    data.putShort(tmp2.get());
                data.rewind();
            }


Something has changed in the library that makes this step no longer necessary as described here.

Also, it would be REALLY nice if SoundSystem.create3DSample() took a URL instead of an absolute path.

I have added URL loading support for create3DSample (openAL part) :slight_smile:

"Arman" wrote:
I have added URL loading support for create3DSample (openAL part) :)
Ok cool, but could you also add the other changes I just listed here??

Hi,

Does this work?

I updated the latest CVS and ran the OpenAL sound test TestSoundGraph but I get a null pointer exception on

footsteps = SoundSystem.create3DSample(TestSoundGraph.class.getResource("/data/sound/CHAR_CRE_1.ogg"));



I checked that all the files were correct, but no joy.



Any ideas?



ty

"sonicviz" wrote:
Hi,
Does this work?
I updated the latest CVS and ran the OpenAL sound test TestSoundGraph but I get a null pointer exception on
footsteps = SoundSystem.create3DSample(TestSoundGraph.class.getResource("/data/sound/CHAR_CRE_1.ogg"));

I checked that all the files were correct, but no joy.

Any ideas?

ty
Probably because it's not loading from the correct path. But why are you posting in this thread?? Make your own.

On topic: could someone would dev privs please add these changes??
"itistoday" wrote:
"sonicviz" wrote:
Probably because it's not loading from the correct path. But why are you posting in this thread?? Make your own.

Well, it's a URL problem isn't it?

It simply can’t find the file with the information given. /data/… is a path that is likely outside of your classpath.