Guten Tag/Abend ich probiere zur Zeit ein bisschen mit OpenAL rum und soweit funktioniert auch alles das Problem ist nur das ich die Position des Sounds nicht festlegen kann. Versuche ich es festzulegen höre ich es immernoch so wie vorher. 
Ich hoffe jemand kennt sich mit OpenAL aus oder könnte mir helfen.
PS: Ich arbeite hier auch noch mit slick-util.
Java:
import java.io.File;
import javax.sound.sampled.AudioSystem;
import org.lwjgl.openal.AL;
import org.lwjgl.openal.AL10;
import org.lwjgl.openal.ALC;
import org.lwjgl.openal.ALC10;
import org.lwjgl.openal.ALCCapabilities;
import org.newdawn.slick.openal.WaveData;
public class Main {
public static void main(String[] args) throws Exception {
String deviceName = ALC10.alcGetString(0, ALC10.ALC_DEFAULT_DEVICE_SPECIFIER);
long device = ALC10.alcOpenDevice(deviceName);
long context = ALC10.alcCreateContext(device, new int[] {0});
ALCCapabilities alcCap = ALC.createCapabilities(device);
ALC10.alcMakeContextCurrent(context);
AL.createCapabilities(alcCap);
//Klasse von slick-util
WaveData wave = WaveData.create(AudioSystem.getAudioInputStream(new File("testWav.wav")));
int bufferData = AL10.alGenBuffers();
AL10.alBufferData(bufferData, wave.format, wave.data, wave.samplerate);
int source = AL10.alGenSources();
AL10.alSourcei(source, AL10.AL_BUFFER, bufferData);
//Festlegen der Position:
AL10.alSource3f(source, AL10.AL_POSITION, 500, 0, 0);
//Abspielen
AL10.alSourcePlay(source);
Thread.sleep(10000000);
AL10.alDeleteBuffers(bufferData);
AL10.alDeleteSources(source);
ALC10.alcDestroyContext(context);
ALC10.alcCloseDevice(device);
ALC.destroy();
}
}
Ich hoffe jemand kennt sich mit OpenAL aus oder könnte mir helfen.
PS: Ich arbeite hier auch noch mit slick-util.