I have a method called setSound() which is setting up a queue and adding a track to it and then playing it. I call the method in simpleInitGame(). However no sound plays and the console in eclipse says:
Mar 13, 2012 10:15:55 PM com.jmex.audio.openal.OpenALSystem setupSourcePool
INFO: max source channels: 32
Mar 13, 2012 10:15:55 PM com.jme.util.resource.ResourceLocatorTool locateResource
WARNING: Unable to locate: src/com/preston/sounds/background.ogg
Mar 13, 2012 10:15:55 PM com.jmex.audio.openal.OpenALSystem createAudioTrack
WARNING: Could not locate audio file: src/com/preston/sounds/background.ogg
Here is the method:
protected void setSound()
{
audio = AudioSystem.getSystem();
sound1 = audio.createAudioTrack("src/com/preston/sounds/background.ogg", false);
queue = AudioSystem.getSystem().getMusicQueue();
queue.setCrossfadeinTime(0);
queue.setRepeatType(RepeatType.ONE);
queue.addTrack(sound1);
queue.play();
}
I don't think it's the directory as my textures are in the same directory (except instead of preston/sounds its preston/textures).