My operating system is Ubuntu Linux 11.04 and I am using Java Slick library to build a game in these days. I faced the following error when I tried to load sounds using Music backMus=new Music(“path/to/file”); .
AL lib: oss.c:179: Could not open /dev/dsp: No such file or directory
ERROR:Sound initialisation failure.
ERROR:Could not locate OpenAL library. org.lwjgl.LWJGLException: Could not locate OpenAL library.
Searched everywhere for hours to find a solution for this and tried many guides which were written to solve this problem, but none of them were a success. Finally I got to know that this error is caused because Slick library uses a very old version of LWJGL (Light Weight Java Gaming Library). If you too are having this same problem use the following guidelines to rectify it.
- Download the latest version of LWJGL from http://lwjgl.org/download.php.(Download the file named lwjgl-x.x.x.zip).
- Extract the downloaded file.
- Copy the libraries that you are using from the jar folder in the extracted directory to your games Slick library folder. (Confirm file overwrites).
- Copy the relevant native files from the native folder to your games Slick natives folder. (Confirm file overwrites).
- Now reload the libraries in your IDE-if you are using any (For an example,in Net Beans remove all the slick libraries and add them again).
Now the game will play the sounds smoothly…!