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

2011/12/10

WAV (Microsoft) signed 16 bit PCM sound file won't play.

Dirk1616 Dirk1616

2011/12/10

#
I keep getting the following code no matter how much I mess with the case-sensitivity. I would like to know how to fix this as soon as possible. java.lang.IllegalArgumentException: Could not open sound file: Nyancat.wav at greenfoot.sound.SoundExceptionHandler.handleIOException(SoundExceptionHandler.java:66) at greenfoot.sound.SoundFactory.createSound(SoundFactory.java:115) at greenfoot.sound.SoundFactory.getCachedSound(SoundFactory.java:130) at greenfoot.Greenfoot.playSound(Greenfoot.java:163) at Bullet.<init>(Bullet.java:25) at Rocket.fire(Rocket.java:120) at Rocket.checkKeys(Rocket.java:95) at Rocket.act(Rocket.java:40) at greenfoot.core.Simulation.actActor(Simulation.java:507) at greenfoot.core.Simulation.runOneLoop(Simulation.java:470) at greenfoot.core.Simulation.runContent(Simulation.java:204) at greenfoot.core.Simulation.run(Simulation.java:194) Caused by: java.io.FileNotFoundException: Could not find file: NYANCAT.wav at greenfoot.util.GreenfootUtil.getURL(GreenfootUtil.java:532) at greenfoot.sound.SoundFactory.createSound(SoundFactory.java:95) ... 10 more java.lang.IllegalArgumentException: Could not open sound file: Nyancat.wav at greenfoot.sound.SoundExceptionHandler.handleIOException(SoundExceptionHandler.java:66) at greenfoot.sound.SoundFactory.createSound(SoundFactory.java:115) at greenfoot.sound.SoundFactory.getCachedSound(SoundFactory.java:130) at greenfoot.Greenfoot.playSound(Greenfoot.java:163) at Bullet.<init>(Bullet.java:25) at Rocket.fire(Rocket.java:120) at Rocket.checkKeys(Rocket.java:95) at Rocket.act(Rocket.java:40) at greenfoot.core.Simulation.actActor(Simulation.java:507) at greenfoot.core.Simulation.runOneLoop(Simulation.java:470) at greenfoot.core.Simulation.runContent(Simulation.java:204) at greenfoot.core.Simulation.run(Simulation.java:194) Caused by: java.io.FileNotFoundException: Could not find file: Nyancat.wav at greenfoot.util.GreenfootUtil.getURL(GreenfootUtil.java:532) at greenfoot.sound.SoundFactory.createSound(SoundFactory.java:95) ... 10 more
davmac davmac

2011/12/10

#
The exception stack trace you posted shows quite clearly a "FileNotFoundException" in both cases, meaning you've got the filename wrong or it's in the wrong place. It's hard to give any advice. You could try uploading the scenario to greenfoot.org and let someone take a look at the whole thing.
giordanno92 giordanno92

2011/12/12

#
I'm not quite sure, but I was also getting a similar error, depending on where you converted your wave file, it might be Nyancat.WAV and not Nyancat.wav. Not sure if it helps.
You need to login to post a reply.