Playing sounds and using buttons with Raspberry Pi

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
heriopimtb
 
Posts: 4
Joined: Thu Mar 13, 2014 9:25 am

Playing sounds and using buttons with Raspberry Pi

Post by heriopimtb »

On the "code" page there are 3 instructions at the top:
How do you insert the code into a file? Does the file exist or do you have to create it. If so, how do you do create and store the file?
Where do you get the audio files and how do you store it in the folder?
How do you make the file executable.

Thanks
Herman

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Playing sounds and using buttons with Raspberry Pi

Post by adafruit_support_mike »

Could you post a link to the page you're talking about please?

heriopimtb
 
Posts: 4
Joined: Thu Mar 13, 2014 9:25 am

Re: Playing sounds and using buttons with Raspberry Pi

Post by heriopimtb »


User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Playing sounds and using buttons with Raspberry Pi

Post by adafruit_support_mike »

The instructions are saying to create a file named "raspi-audio-button.py", copy the code from the webpage into that file, then tell the OS to treat the file as a program it can run.

There are *many* different ways to create a file on a Linux machine. The `nano` text editor is fairly beginner-friendly and should let you create/edit/save the file:

Code: Select all

nano raspi-audio-button.py
will get things started.

Once you've copied the code to the file and saved it, use the command:

Code: Select all

chmod +x raspi-audio-button.py
to make it runnable.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”