JukeBox
InputStream in = JukeBox.class.getResourceAsStream(s);
InputStream bin = new BufferedInputStream(in);
AudioInputStream ais = AudioSystem.getAudioInputStream(bin);
AudioFormat baseFormat = ais.getFormat();
PlayState
JukeBox.load("/Music/bgmusic.mp3", "music1");
JukeBox.setVolume("music1", -10);
JukeBox.loop("music1", 1000, 1000, JukeBox.getFrames("music1") - 1000);
*javax.sound.sampled.UnsupportedAudioFileException: Stream of unsupported format*
at java.desktop/javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1014)
at com.neet.DiamondHunter.Manager.JukeBox.load(JukeBox.java:37)
at com.neet.DiamondHunter.GameState.PlayState.init(PlayState.java:95)
at com.neet.DiamondHunter.Manager.GameStateManager.setState(GameStateManager.java:60)
I'm working on a JavaFX project and these codes cause the error and freezing the program.