A simple ChatGPT voice assistant using OpenAI API and Gradio to provide a user interface where users can record their queries, choose a role for ChatGPT to take and receive spoken responses tailored to that role.
- Python 3.6 or higher
- OpenAI
- Gradio
- gTTS
- Soundfile
- FFmpeg
git clone https://github.com/your-github-username/chatgpt-voice-assistant.git
cd chatgpt-api-whisper-api-voice-assistant
python3 -m venv venv
-
source venv/bin/activate
-
.\venv\Scripts\activate
pip install -r requirements.txt
If not done already, please create a config.py file in the project folder and add the OpenAI API key you obtained from the OpenAI Dashboard
OPENAI_API_KEY = "your_openai_api_key_here"
Replace your_openai_api_key_here with your actual API key.
Download the FFmpeg binaries from the official website: FFmpeg Download-Seite Extract the downloaded files and add the extracted folder containing the FFmpeg exe files (usually bin) to the PATH environment variable. You can follow instructions on how to do that here: Install FFmpeg on Windows
brew install ffmpeg
sudo apt-get update
sudo apt-get install ffmpeg
To start the ChatGPT voice assistant, run the main script:
python assistant.py
Or start your IDE Python environment with the assistant.py script.
After that, open your web browser and navigate to the displayed URL (usually http://localhost:7860/), to use the voice assistant interface.
Author: Martin Haferanke - Original version forked by: Hacking the Markets, Part Time Larry