Steps:
- Download latest Raspberry Pi OS Lite (https://www.raspberrypi.org/software/operating-systems/)
- Flash it on the SD card
- Start the Raspberry Pi, and login with username
pi
and passwordraspberry
(https://www.raspberrypi.org/documentation/linux/usage/users.md) - Connect to Wi-Fi (https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md)
- Activate SSH (https://www.raspberrypi.org/documentation/configuration/raspi-config.md)
- Install pip with
sudo apt install python3-pip
(https://www.raspberrypi.org/documentation/linux/software/python.md) - Install Espeak NG with
sudo apt-get install espeak-ng
(https://github.com/espeak-ng/espeak-ng/blob/master/docs/guide.md)
Espeak-NG works out of the box, but the voice is quite robotic and it seems to "chew" the words.
Possible solutions:
- use Mbrola voices
The installation does not appear straight-forward.
Try one of the many tutorials. Example: https://www.makeuseof.com/tag/add-button-raspberry-pi-project/ Usually they involve an LED, but you can skip it.
Steps:
- On your main pc, copy the file
raspberry_test_button.py
over to the Raspberry Pi
scp raspberry_test_joke.py pi@[RASPBERRYPI IP]:/home/pi/
- Run the file
raspberry_test_button.py
python3 raspberry_test_button.py
Make sure that when the button is pressed, the output prints the proper result.
Steps:
- Install
pyttsx3
withpip3 install pyttsx3
- On your main pc, copy the file
raspberry_test_joke.py
over to the Raspberry Pi
scp raspberry_test_joke.py pi@[RASPBERRYPI IP]:/home/pi/
- Connect the hearphones to the Raspberry Pi
- Run the file
raspberry_test_joke.py
python3 raspberry_test_joke.py
Make sure that when the button is pressed, you can hear a joke through the hearphones.