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

2017/1/23

Sound

Solomon Solomon

2017/1/23

#
I have an actor called Sound1, with this code if (Greenfoot.mouseClicked(this)) Greenfoot.playSound("dog"); when i click the img(the actor) i get this java.lang.IllegalArgumentException: Could not open sound file: dog at greenfoot.sound.SoundExceptionHandler.handleIOException(SoundExceptionHandler.java:67) at greenfoot.sound.SoundFactory.createSound(SoundFactory.java:120) at greenfoot.Greenfoot.playSound(Greenfoot.java:163) at Sunet1.act(Sunet1.java:18) at greenfoot.core.Simulation.actActor(Simulation.java:604) at greenfoot.core.Simulation.runOneLoop(Simulation.java:562) at greenfoot.core.Simulation.runContent(Simulation.java:221) at greenfoot.core.Simulation.run(Simulation.java:211) Caused by: java.io.FileNotFoundException: Could not find file: dog at greenfoot.util.GreenfootUtil.getURL(GreenfootUtil.java:551) at greenfoot.sound.SoundFactory.createSound(SoundFactory.java:99) ... 6 more the file "dog" is a WAV file
Super_Hippo Super_Hippo

2017/1/23

#
Try to use "dog.wav" instead of only "dog".
You need to login to post a reply.