I have gotten to the point in Ghost of John where I feel that I need music, but nothing seems to work. Here are the important bits:
Code:
package goj;
import org.lwjgl.input.Mouse;
import org.newdawn.slick.*;
import org.newdawn.slick.state.*;
import org.newdawn.slick.Sound;
public class Menu extends BasicGameState {
Sound title;
public Menu(int state) {
}
public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
title = new Sound("res/audio/title.ogg");
title.play();
}
public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {
}
public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {
}
public int getID() {
return 0;
}
}
I've taken out all the irrelevant code, but I'm wondering what I've done wrong. I'm certain the OGG is in the right place, and I've tried replaced the "Sound" with "Music", but nothing seems to work. I always get this:
Code:
Sun Jun 17 18:21:43 EST 2012 INFO:Slick Build #274
Sun Jun 17 18:21:43 EST 2012 INFO:LWJGL Version: 2.8.4
Sun Jun 17 18:21:43 EST 2012 INFO:OriginalDisplayMode: 1920 x 1080 x 32 @60Hz
Sun Jun 17 18:21:43 EST 2012 INFO:TargetDisplayMode: 640 x 480 x 0 @0Hz
Sun Jun 17 18:21:43 EST 2012 INFO:Starting display 640x480
Sun Jun 17 18:21:43 EST 2012 INFO:Use Java PNG Loader = true
Sun Jun 17 18:21:43 EST 2012 INFO:Controllers not available
Sun Jun 17 18:21:43 EST 2012 INFO:Initialising sounds..
Sun Jun 17 18:21:43 EST 2012 INFO:- Sound works
Sun Jun 17 18:21:43 EST 2012 INFO:- 64 OpenAL source available
Sun Jun 17 18:21:43 EST 2012 INFO:- Sounds source generated
AL lib: FreeContext: (0000000010B051F0) Deleting 64 Source(s)
Exception in thread "main" java.lang.NoClassDefFoundError: com/jcraft/jorbis/Info
at org.newdawn.slick.openal.OggInputStream.<init>(OggInputStream.java:35)
at org.newdawn.slick.openal.OggDecoder.getData(OggDecoder.java:311)
at org.newdawn.slick.openal.SoundStore.getOgg(SoundStore.java:835)
at org.newdawn.slick.openal.SoundStore.getOgg(SoundStore.java:793)
at org.newdawn.slick.Sound.<init>(Sound.java:58)
at goj.Menu.init(Menu.java:23)
at goj.Game.initStatesList(Game.java:19)
at org.newdawn.slick.state.StateBasedGame.init(StateBasedGame.java:164)
at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
at goj.Game.main(Game.java:30)
Caused by: java.lang.ClassNotFoundException: com.jcraft.jorbis.Info
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 11 more
I'm trying to work this out, and I've checked all the places listed, and even the Javadoc.