General > Other Support

LibraryLWJGLOpenAL does not allow Listener to Function


So I'm at a loss. I have a basic setup where LibraryJavaSound is a backup from OpenAL. LibraryJavaSound works perfectly for Listener positions and fading, but not pitch. OpenAL is JUST the opposite.

I have a method called repositionListener which passes arguments for a Player object, float x, float y. This method is called in a step method every time the player moves. It works only for LibraryJavaSound and I have spent hours trying to figure this out. All it contains is setListenerPosition and setListenerOrientation. Why won't it work for OpenAL specifically?

Any help would be appreciated.

Do you have a simplified bit of code that has the problem with OpenAL?  My initial guess is that you are using a stereo sound file instead of mono, but that is pure speculation.

As far as missing pitch in JavaSound, that may be due to a control missing on your specific system (not all controls are available on every system)

Ohhh, the JavaSound bit does make perfect sense. Have any idea of how I could "emulate" this? I know Java was smart and removed support for the default mixer...

As for the code, sorry I didn't post it originally. You, seemingly, are one of the few people alive who still employ anti-spam. Here it is...
public void playSound(boolean priority, String identifier, boolean loop, float x, float y, float z, float pitch) {
      sound.newSource(priority, identifier, identifier, loop, x, y, z, SoundSystemConfig.ATTENUATION_ROLLOFF, SoundSystemConfig.getDefaultRolloff());
      if(LibraryLWJGLOpenAL.alPitchSupported()) sound.setPitch(identifier, pitch);

...and for moving my player...
public void repositionListener(EntityPlayer player, float x, float y) {
      sound.setListenerPosition(x, y, 0F);
      sound.setListenerOrientation(Mineblock.getSingleplayerGame().getPlayerController().getPlayer().getEyeLocation().getX(), Mineblock.getSingleplayerGame().getPlayerController().getPlayer().getEyeLocation().getY(), 0F, x, y, 0F);
...this method, which gets called every player step.

Really appreciate your help, Paul.

Hmm.. that seems like it should work.  Do you mind sending me one of the sound files you are using which has the problem, so I can run some tests?

newbielink: [nonactive]

This is one I'm using out of many.


[0] Message Index

Go to full version