I want to play sound in the background of my game launcher but when i try to play sound i get this error. Failed to allocate clip data: Requested buffer too large.
Here is my sound code:
public static void Sound() {
try {
AudioInputStream audio = AudioSystem.getAudioInputStream(new File("LauncherBG.wav"));
Clip clip = AudioSystem.getClip();
clip.open(audio);
clip.start();
CStop = clip;
}
catch (UnsupportedAudioFileException uae) {
System.out.println(uae);
} catch (IOException ioe) {
System.out.println(ioe);
} catch (LineUnavailableException lua) {
System.out.println(lua);
}
}
the wav is 16mb and it is 1:33 mins long please help