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

2018/4/5

Getting error with Greenfoot.playSound()

fionn88 fionn88

2018/4/5

#
Hi, I'm taking the edx.org Java course, and I'm at the point where we downloaded the Greenfoot car project. I'm trying to add a horn sound when the h key is pressed. I put the horn.wav file in the sounds folder within the scenario, but it keeps giving me an error that it cannot find the file and that it cannot open the file. If I double-click on the horn.wav file in the folder, it does play. The spelling of the file is exactly the same (filename and in the code). What am I missing? Thanks in advance, fionn88 [Disallowed URL]
danpost danpost

2018/4/5

#
Make sure the suffix is cased appropriately also (try both wav and WAV).
fionn88 fionn88

2018/4/6

#
I tried both this morning, but still no luck. What else can I try? I'm trying to attach a screenshot so you can see my code, the errors I'm getting, and the name of the file/file location. http://i393.photobucket.com/albums/pp18/pprioli/Greenfoot%20errors.jpg
You need to login to post a reply.