Create a ChatGPT voice bot on a Raspberry Pi
Introduction
Initial setup
Configure and test audio
Create the Python application
Run and test the bot
Next Steps
Create a ChatGPT voice bot on a Raspberry Pi
Install Raspberry Pi OS
Download, install, and use Raspberry Pi Imager to create a microSD card with Raspberry Pi OS .
If you are new to Raspberry Pi or would like more information the Raspberry Pi getting started documentation is excellent.
The steps to install using Imager are:
- Select your Raspberry Pi device, such as Raspberry Pi 5
- Under Operating System, choose Raspberry Pi OS (64-bit)
- Under Storage, select your microSD card
- Click Next
- When it asks you “Would you like to apply OS customization settings?”, select
EDIT SETTINGS - Check Set username and password, Configure wireless LAN, Set locale settings, enter the settings, and click
SAVE - Click
YESto apply the settings - Click
YESto erase the card and start writing the data
When Imager is finished writing and verifying the microSD card, you can remove it from your computer.
Power on the Raspberry Pi
Insert the microSD card into the Raspberry Pi, power it on, and boot to the Raspberry Pi OS desktop.
Make sure the Raspberry Pi is connected to your network before proceeding.
Install the required software
Open the terminal application by opening the menu on the top left corner and select Accessories and Terminal.
Copy and paste the commands below at the terminal prompt:
sudo apt update
sudo apt upgrade -y
Install the required software for the project:
sudo apt install portaudio19-dev python3-pyaudio mpg321 flac vim -y
Restart the Raspberry Pi:
sudo reboot
Setup the required services and access keys
Porcupine
Porcupine, from Picovoice , is a wake word detection engine which can be accessed as a cloud service.
Create a Forever-Free account to use for personal projects by following the steps below:
Use a browser and navigate to Picovoice’s Porcupine
Click
Start FreeClick
Sign Upto create a Forever-Free account as shown below:

On the right, under Get started, sign in using your GitHub, Google, or LinkedIn account
Get your access key for Porcupine wake word, save it somewhere safe, and don’t share it with anyone
OpenAI
The OpenAI API provides a bridge to machine learning models so you can integrate AI features in applications.
The OpenAI API is not free with pricing based on usage. You can find out more by reviewing the OpenAI pricing .
Create an OpenAI account at OpenAI account sign up or, if you already have an account, log in at OpenAI account login .
Navigate to the API key page and select
Create new secret keySave the key somewhere safe (don’t share it with anyone)
You have now set up your Raspberry Pi as well as the required API keys. You are ready to start the project.