Here's the code:
private void startUp()
{
addObject(lily, 317, 28);
addObject(life, 543, 15);
addObject(new Monster1(), 48, 450);
addObject(new Bear(), 337, 221);
addObject(new Bear(), 481, 68);
addObject(new Bear(), 125, 102);
addObject(new Exit(), 557, 428);
Greenfoot.playSound("music02.wav"); //<----refuses to play
}
public void detectBear()
{
if(isTouching(Bear.class))
{
removeTouching(Bear.class);
bearsFound++;
score = score + 200;
Greenfoot.playSound("get.wav"); //<--- also refuses to play
}
}
public void dead()
{
getWorld().showText("Congratulations, you killed a child.", 317, 28);
Greenfoot.playSound("gameover.wav");
}
All 3 of the sounds are located in the "sounds" folder of my Greenfoot project, and play when double-clicked inside the folder.
Here is the error code(s):
Exception in thread "Thread-386" java.lang.IllegalArgumentException: Format of sound file not supported: file:/F:/TECH/CSA/Greenfoot/MY%20GAME/sounds/music02.wav
at greenfoot.sound.SoundExceptionHandler.handleUnsupportedAudioFileException(SoundExceptionHandler.java:57)
at greenfoot.sound.SoundClip.open(SoundClip.java:125)
at greenfoot.sound.SoundClip.processState(SoundClip.java:273)
at greenfoot.sound.ClipProcessThread.run(ClipProcessThread.java:74)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input URL
at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1155)
at greenfoot.sound.ClipCache.getCachedClip(ClipCache.java:67)
at greenfoot.sound.SoundClip.load(SoundClip.java:137)
at greenfoot.sound.SoundClip.open(SoundClip.java:108)
... 3 more
Exception in thread "Thread-387" java.lang.IllegalArgumentException: Format of sound file not supported: file:/F:/TECH/CSA/Greenfoot/MY%20GAME/sounds/get.wav
at greenfoot.sound.SoundExceptionHandler.handleUnsupportedAudioFileException(SoundExceptionHandler.java:57)
at greenfoot.sound.SoundClip.open(SoundClip.java:125)
at greenfoot.sound.SoundClip.processState(SoundClip.java:273)
at greenfoot.sound.ClipProcessThread.run(ClipProcessThread.java:74)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input URL
at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1155)
at greenfoot.sound.ClipCache.getCachedClip(ClipCache.java:67)
at greenfoot.sound.SoundClip.load(SoundClip.java:137)
at greenfoot.sound.SoundClip.open(SoundClip.java:108)
... 3 more
Exception in thread "Thread-388" java.lang.IllegalArgumentException: Format of sound file not supported: file:/F:/TECH/CSA/Greenfoot/MY%20GAME/sounds/gameover.wav
at greenfoot.sound.SoundExceptionHandler.handleUnsupportedAudioFileException(SoundExceptionHandler.java:57)
at greenfoot.sound.SoundClip.open(SoundClip.java:125)
at greenfoot.sound.SoundClip.processState(SoundClip.java:273)
at greenfoot.sound.ClipProcessThread.run(ClipProcessThread.java:74)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input URL
at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1155)
at greenfoot.sound.ClipCache.getCachedClip(ClipCache.java:67)
at greenfoot.sound.SoundClip.load(SoundClip.java:137)
at greenfoot.sound.SoundClip.open(SoundClip.java:108)
... 3 more
The "get" sound is supposed to play whenever the character touches one of the 3 bears laid out randomly on the screen. The sound "gameover" is supposed to play when the player's five lives are gone, and the "music02" sound is supposed to play upon startup. Please help?

