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

2014/7/10

Problem with creating and playing sound files

rodr rodr

2014/7/10

#
I have created a my own sound file to use in "trick-the-turtle" however I keep getting unable to find the file error' I have opened the sound file and by clicking on the file played the sound. I have inserted the name of my sound file into the Greenfoot.playSound("slurp.wav") and still get the unable to find file error I am really stuck on this one. I do not want to go further until I get this sorted. Any advice would be appreciated.
danpost danpost

2014/7/10

#
Did you place the sound file within the 'sounds' folder within the scenario folder of that which you wish to play the sound from?
rodr rodr

2014/7/10

#
Yes - I am following the tutorial on "trick-the-turtle" . In lesson 12 you write the code for for inserting sound into the game. There are only 2 sound files provided in the resources sound file folder, ie "au.wav" and "slurp.wav". Both of the sound files work fine. I have put my sound file into the same folder. When I run my own sound within the coding of the tutorial I get an file not found error. I have put my sound file to replace "slurp.wav" and still there is the file not found error. I have opened the sound file which shows all three sound files, if I click on each one it opens and plays the sound. thank you for your reply rodr
danpost danpost

2014/7/10

#
If you placed the sound file properly within the project folder (in the 'sounds' folder), for example: "C://Greenfoot/scenario/trick_the_turtle/sounds/slurp.wav" and you used the exact filename -- "slurp.wav" (using exact case for all characters) -- then it should play during the running of your project.
davmac davmac

2014/7/11

#
rodr, perhaps try uploading your scenario (to this site) and link to it. Then we can have a look and see what's wrong.
rodr rodr

2014/7/11

#
Hi. found the problem, I need to pay more attention to detail. I can now get on with the next tutorial. Thank you all for your replies. Kind regards rodr.
You need to login to post a reply.