A hands-on tutorial to build a voice assistant with Google Gemini on Raspberry Pi
Following the YouTube video below to learn more about this project:
https://youtu.be/uV6hJQcuW4w
Before using this Python script, please add your Google Gemini API key to it first.
Here is a schematic of the Raspberry Pi and LEDs
- Raspberry Pi: https://amzn.to/4bmstJa
- microSD card: https://amzn.to/4cFs84s
- Audio amplifier: https://amzn.to/3JjPWy9
- Mini speaker: https://amzn.to/3TB9Pp3
- USB Microphone: https://amzn.to/3HGGSCA
- (optional) LEDs and resistors: https://amzn.to/3Jg4Yoz
- (optional) Breadboard https://amzn.to/3V3ruWY
- uni SD Card Reader https://amzn.to/3yYhwze
- Power Supply for Raspberry Pi 4: https://amzn.to/3RVKXIF or for Pi 5: https://amzn.to/3L9kC67
- Audio cable for speaker: https://amzn.to/3yXD8vy
- Pi 4 case with cooling fan and heatsink: https://amzn.to/4hgnfBV
sudo apt update
sudo apt upgrade
sudo apt install ufw
sudo ufw allow ssh
sudo ufw enable
sudo apt install python3 python3-pip python3-venv
python3 -m venv .venv
sudo apt install portaudio19-dev python3-pyaudio flac espeak
mkdir projects
cd projects
mkdir va
cd va
source ~/.venv/bin/activate
You will need to install the following packages:
pip install speechrecognition sounddevice pyaudio
pip install -q -U google-generativeai
pip install gtts pygame gpiozero lgpio
python gva7_led.py
Press "Ctrl + C" on your keyboard to exit from a running Python program.
sudo poweroff
* As a participant in the Amazon Associate Program, we earn from qualifying purchases.