This site requires JavaScript, please enable it in your browser!
Greenfoot back
AnneMacaroni
AnneMacaroni wrote ...

2013/1/19

cannot open sound file?

AnneMacaroni AnneMacaroni

2013/1/19

#
I have a sound file that is around 1MB call "themeSong.mp3". When I called Greenfoot.playSound("themeSong.mp3") in the world, an error came up and first said could not find file, and then it said could not open file..... I had the file inside the sounds folder. So how come it doesn't work?
AnneMacaroni AnneMacaroni

2013/1/19

#
this is what came up.... java.lang.IllegalArgumentException: Could not open sound file: themeSong.mp3 at greenfoot.sound.SoundExceptionHandler.handleIOException(SoundExceptionHandler.java:66) at greenfoot.sound.SoundFactory.createSound(SoundFactory.java:120) at greenfoot.Greenfoot.playSound(Greenfoot.java:162) at DogWorld.act(DogWorld.java:113) at greenfoot.core.Simulation.actWorld(Simulation.java:571) at greenfoot.core.Simulation.runOneLoop(Simulation.java:506) at greenfoot.core.Simulation.runContent(Simulation.java:213) at greenfoot.core.Simulation.run(Simulation.java:203) Caused by: java.io.FileNotFoundException: Could not find file: themeSong.mp3 at greenfoot.util.GreenfootUtil.getURL(GreenfootUtil.java:534) at greenfoot.sound.SoundFactory.createSound(SoundFactory.java:99) ... 6 more
AnneMacaroni AnneMacaroni

2013/1/19

#
NVM, I got it :P
You need to login to post a reply.