Fix OpenAL ignoring the requested output device (#366)

This commit is contained in:
Algent authored and GitHub committed 2026-09-07 17:18:58 +01:00
1 parent bc12f5818c
commit a2eac5eca5
1 file changed
+3 -5
+3 -5
View File
@@ -4,7 +4,6 @@ import static org.lwjgl.system.MemoryStack.stackPush;
import java.nio.IntBuffer;
import org.lwjgl.openal.ALC10;
import org.lwjgl.openal.ALCCapabilities;
import org.lwjgl.system.MemoryStack;
import org.lwjglx.LWJGLException;
@@ -63,12 +62,11 @@ public class AL {
attribs.put(0);
attribs.flip();
String defaultDevice = org.lwjgl.openal.ALC10.alcGetString(0, ALC10.ALC_DEFAULT_DEVICE_SPECIFIER);
long deviceHandle = org.lwjgl.openal.ALC10.alcOpenDevice(defaultDevice);
long deviceHandle = org.lwjgl.openal.ALC10.alcOpenDevice(deviceArguments);
if (deviceHandle == 0) {
throw new LWJGLException("Could not open ALC device");
throw new LWJGLException(
"Could not open ALC device: " + (deviceArguments == null ? "default" : deviceArguments));
}
alcDevice = new ALCdevice(deviceHandle);