ValenciaPilgrim
Posts: 1
Joined: Tue Sep 05, 2017 4:14 am

Burping Jelly Baby

Tue Sep 05, 2017 4:11 pm

Hi I am trying to figure out the Burping Jellybaby activity so I can do it with my teen code club at the library.
https://projects.raspberrypi.org/en/pro ... jelly-baby

Everything seeems to go right, until the very end. When I try to run the program by clicking on Run and Run Module (in Python 3), this error message comes up in red:

Traceback (most recent call last):
File "/home/pi/burp.py", line 9 in <module>
burp = pygame.mixer.Sound("burp.wav")
pygame.error:Unable to open file 'burp.wav'

I did all the steps, I have double and tripple checked the code I entered in for mistakes. Any ideas would be appreciated.

-Jacque

User avatar
topguy
Posts: 4259
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Burping Jelly Baby

Tue Sep 05, 2017 7:04 pm

When in doubt, use full path to the file you are trying to open.
Where is the burp.wav file located ?
Then use "/home/pi/where/burp.wav" instead of just "burp.wav".

( "/home/pi" can also be replaced with "~/" so "~/where/burp.wav" is also a posibility )

EDIT:
Did you do the "sound of a burp" step in the guide ?
If so then I guess "~/jellybaby/burp.wav" should work, but you can verify with the command "ls -l ~/jellybaby", is should then list "burp.wav".

B.Goode
Posts: 5239
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Burping Jelly Baby

Tue Sep 05, 2017 7:19 pm

I think there may be an unforeseen error in the instructions in the tutorial.

The burp.wav file should be in the directory (folder) /home/pi/jellybaby .

Your burp.py script will have been created in /home/pi/ .

@topguy seems to have come to the same conclusion.

This can be 'repaired' in one of several ways:

. Copy the script into the jellybaby directory with the sound file.

. Copy the sound file into your top level directory with the script

. Use the whole path to the sound file in the script

B.Goode
Posts: 5239
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Burping Jelly Baby

Tue Sep 05, 2017 8:30 pm

Raised as an Issue on the Raspberry Pi Foundation github repository for this resource.

https://github.com/raspberrypilearning/ ... /issues/23]

Return to “Teaching and learning resources”

Who is online

Users browsing this forum: No registered users and 2 guests