Hello Guest

Sound wont play

  • 1 Replies
Sound wont play
« on: December 06, 2014, 14:49:23 »
Hey guys

I know there are topics with the same kind of problems, but the solutions couldn't solve my problems. I've started with OpenAL today and my audio just won't play. Code compiles fine without errors, but I hear nothing. OpenAL however returns error 40962 which is AL_INVALID_ENUM.

Code: (Sound.java) [Select]
import util.*;

import jarmer.*;
import jarmer.core.*;
import jarmer.graphics.*;
import jarmer.input.*;
import jarmer.light.*;
import jarmer.math.*;

import java.io.*;
import java.nio.*;

import org.lwjgl.*;
import org.lwjgl.openal.*;
import org.lwjgl.openal.AL.*;
import org.lwjgl.openal.AL10.*;
import static org.lwjgl.openal.AL10.*;

public class Game {

private static IntBuffer buffer;
private static IntBuffer source;
private static FloatBuffer sourcePos;
private static FloatBuffer sourceVel;
private static FloatBuffer listenerPos;
private static FloatBuffer listenerVel;
private static FloatBuffer listenerOri;

public void run() {

//Initialize display

Sound snd = new Sound("spawn.wav");


//Main loop
while (!Window.isClosed()) {

//Clean up


public void update() {

//Quit game with the ESC key
if (Keyboard.isKeyDown(Keys.escape)) {
public void render() {


The sound I'd like to play is attached.


Offline quew8

  • *****
  • 569
  • Because Square Eyes Look More Real
Re: Sound wont play
« Reply #1 on: December 07, 2014, 12:41:11 »
You haven't shown us any of the OpenAL code in "Sound." There is no way we can diagnose this error. Also make sure you track down the exact function call which is causing the AL_INVALID_ENUM error.