paulscode 3D sound issues

	public static void playAt(String sound, float x, float y, float z) {
		ss.setListenerPosition(Game.player.pos.x, Game.player.pos.y, Game.player.pos.z);
		ss.setListenerVelocity(Game.player.dVel.x, 0, Game.player.dVel.y);
		ss.setListenerAngle(Game.player.yaw);
		ss.quickPlay(false, sound, false, x, y, z, SoundSystemConfig.ATTENUATION_ROLLOFF, 0.03f);
	}

My issue is that above code even though I tried every possible value for the rolloff between 0 and 1 (suggested by the PDF paul provided) won’t have any change on the sound’s volume

Bump, I need help on this urgently

Hi

Please keep in mind that we are volunteers.

Which backend do you use? JavaSound? JOAL? Have you looked at the source code? Maybe the roll off factor is not taken into account in some cases.

Also, what OS?

I highly suspect you’re using the JavaSound backend with a JavaSound implementation that doesn’t support volume control - it’s a key flaw in this library that it lacks a built in software mixer.

I’m using LWLJGL OpenAL

Checking if LWJGL OpenAL is compatible...
    ...yes

Checking if Java Sound is compatible...
    ...no

Starting up SoundSystem...
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
OpenAL initialized.

Ah well, suspicions incorrect! :emo:

Over to someone who knows more about OpenAL and this lib then. ;D

JOAL and its competitor use OpenAL-Soft.

Quarry, have you looked at the source code a bit to know whether this setting is not ignored?

I meant that the JavaSound backend is missing a software mixer.

I wish you’d stop using that “competitor” word - it’s just going to be confusing to anyone who doesn’t know you! :wink:

I checked the source code and couldn’t find anything out of place, this is really bothering me!

Here’s my Sounder class, I’m not sure if anything is out of place…

http://pastebin.com/LN7fEnnq

For the small chance, your passing a global volume sound in, and its not specific to that sound file.


soundSystem.setMasterVolume(1.0f);

Also, if you decide to reload the sounds into the sound system, you can specify the sound and specify the volume of a particular sound file.


soundSystem.setVolume(sourceName, volume);

So, I recalled that Minecraft also uses the same library. So I went on to my decompiled copy and found out that it uses ATTENUATION_LINEAR

It works now

Fix your code paul

Ah, writers of free code love that sort of attitude! ::slight_smile: How about reporting a bug or asking him about it?

Incidentally, are you using a stereo sound file? The JavaDoc does say this only works with mono sounds in OpenAL. May not be a bug at all!

All my sounds are mono

There are 2 sets of Java bindings (JogAmp, …) for several native APIs (OpenGL, OpenAL, OpenCL). Their respective teams are in competition even though I don’t like this situation. Therefore, the term “competitor” seems to be the right one.

I kind of meant just name the damn thing. ;D It’s called LWJGL - there, not so hard! It’s OK for projects to refer to each other. To not do so makes you sound about 5! :stuck_out_tongue: