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.gitcd chatgpt-api-whisper-api-voice-assistantpython3 -m venv venv-
source venv/bin/activate -
.\venv\Scripts\activate
pip install -r requirements.txtIf 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 ffmpegsudo apt-get update
sudo apt-get install ffmpegTo start the ChatGPT voice assistant, run the main script:
python assistant.pyOr 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