Hi,
I am trying to play music on my title screen, however I cant seem to do it properly, the sound just keeps playing the first note over and over. initSound() is being loaded in before everything, and then is used in draw()
public static Audio titleTheme;
public static void initSound() {
try {
//Load title theme music
titleTheme = AudioLoader.getAudio("WAV", ResourceLoader.getResourceAsStream("res/sound/Title Theme.wav"));
} catch (IOException e) {
e.printStackTrace();
}
}
public void draw() {
// first two arguments are pitch and gain, the boolean is whether to loop the content
titleTheme.playAsMusic(1.0f, 1.0f, true);
}
I havent used OpenAL/Slick-Util music before so please excuse my ignorance.
Thank you,
- Dan