When i run the scenario, somethimes i get this weird error :
This is the code in that scenario :
1 2 3 4 5 6 7 8 | Exception in thread "SoundStream:file:/C:/Users/ursug/Documents/GitHub/PrisonBreak/PrisonBreak/sounds/jail.mp3" java.lang.IllegalArgumentException: Could not open sound file: file:/C:/Users/ursug/Documents/GitHub/PrisonBreak/PrisonBreak/sounds/jail.mp3 at greenfoot.sound.SoundExceptionHandler.handleIOException(SoundExceptionHandler.java: 66 ) at greenfoot.sound.SoundStream.run(SoundStream.java: 374 ) at java.base/java.lang.Thread.run(Thread.java: 834 ) Caused by: java.io.IOException: javazoom.jl.decoder.BitstreamException: Bitstream errorcode 102 at greenfoot.sound.Mp3AudioInputStream.read(Mp3AudioInputStream.java: 251 ) at greenfoot.sound.SoundStream.run(SoundStream.java: 302 ) ... 1 more |
1 2 3 4 5 6 7 8 9 10 11 12 | public static GreenfootSound soundtrack = new GreenfootSound( "jail.mp3" ); private boolean musicStart = false ; public MainMenu() { super ( 1200 , 700 , 1 ); prepare(); } public void act() { MusicStart(); } |
1 2 3 4 5 6 7 8 9 | public void MusicStart() { if (musicStart == false ) { soundtrack.playLoop(); soundtrack.setVolume( 100 ); musicStart = true ; } } |