[GREENFOOT-229] sounds not located in scenario root directory on Greenfoot Gallery export
If a sound is placed into the root directory of a scenario, Greenfoot will play it, and a webpage export of the scenario will play it. However, a Greenfoot Gallery export will throw exceptions because it is not locating the sound file in a 'sounds' directory.
If sounds are placed in a 'sounds' directory within the scenario directory, a Greenfoot Gallery export will perform correctly.
Example error: java.lang.IllegalArgumentException: Format of sound file not supported: 15488+djgriffin+tibetan_chant_4_colargol_2_modified.wav at greenfoot.Greenfoot.playSound(Greenfoot.java:141) at SoundLooper.start(SoundLooper.java:73) at OuterSpace.act(OuterSpace.java:121) at greenfoot.core.Simulation.runOneLoop(Simulation.java:274) at greenfoot.core.Simulation.run(Simulation.java:158) Caused by: javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input URL at javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source) at greenfoot.sound.SoundClip.open(SoundClip.java:70) at greenfoot.sound.SoundClip.play(SoundClip.java:127) at greenfoot.sound.SoundPlayer.play(SoundPlayer.java:144) at greenfoot.Greenfoot.playSound(Greenfoot.java:135)
Steps to reproduce:
Write a scenario that utilizes a played sound. Place the sound file in the scenario root directory.
- Verify that the scenario performs correctly within Greenfoot and on export to webpage.
- Export scenario to Greenfoot Gallery and test.
- Compare steps 2 and 3 to placing sound file in 'sounds' directory within the scenario root.
Caveats: bq. This bug was not seen by Greenfoot Developer Michael K?lling on Mac OS X 10.5.6, with the latest Java update. Whether this is due to OS, Java version, or some other factor is unknown.
The bug has been confirmed on Windows and Linux operating systems, i386 architecture and PowerPC CPU architectures, and on Sun Java and the OpenJDK open source Java implementation.
Issue metadata
- Issue type: Bug
- Priority: Low
- Fix versions: 1.5.2