ChatGPT-OpenAI-Smart-Speaker  by Olney1

AI smart speaker for voice-driven conversations

created 2 years ago
297 stars

Top 90.4% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This project provides a DIY AI smart speaker leveraging OpenAI's GPT models for conversational AI, coupled with speech-to-text (STT) and text-to-speech (TTS) capabilities. It targets hobbyists and developers looking to build custom voice-controlled assistants with web search integration via Langchain agents.

How It Works

The system utilizes a combination of Python scripts for different deployment targets. PC/Mac versions (chat.py, test.py) directly use the microphone and speakers, integrating OpenAI for responses and gTTS for audio output. The Raspberry Pi version (pi.py) employs Picovoice for efficient wake-word detection and integrates with a ReSpeaker 4-Mic Array for enhanced audio input and visual feedback via APA102 LEDs. Web search is enabled through Tavily API integration.

Quick Start & Requirements

  • PC/Mac:
    • Install: pip install openai pyaudio SpeechRecognition gTTS playsound python-dotenv pyobjc (Mac)
    • Prerequisites: Python 3.7.3+, OpenAI API key, working microphone/speakers. brew install portaudio on macOS.
    • Run: python chat.py or python test.py
  • Raspberry Pi (4b recommended):
    • Install: pip install openai pyaudio SpeechRecognition gTTS pydub python-dotenv apa102-pi gpiozero and pip install -r requirements.txt. Install portaudio19-dev, ffmpeg, python3-dev, libasound2-dev, python3-rpi.gpio. Follow Seeed ReSpeaker guide.
    • Prerequisites: Raspberry Pi 4b, ReSpeaker 4-Mic Array (or alternative mic/speaker), OpenAI API key, Tavily Search API key, PicoVoice Access Key & Custom Voice Model. Python 3.9+ recommended.
    • Run: python3 pi.py
    • Docs: https://wiki.seeedstudio.com/ReSpeaker_4_Mic_Array_for_Raspberry_Pi/

Highlighted Details

  • Supports wake-word detection ("Jeffers" by default) via PicoVoice for Raspberry Pi.
  • Integrates web search capabilities using Langchain agents and Tavily API.
  • Provides visual feedback on Raspberry Pi using APA102 LEDs with ReSpeaker array.
  • Allows customization of OpenAI model, language, and response temperature.

Maintenance & Community

Licensing & Compatibility

  • License: Not explicitly stated in the README.

Limitations & Caveats

  • ReSpeaker hardware is listed as retired by Seeed Studio and may have compatibility issues with Raspberry Pi 5.
  • Raspberry Pi setup involves numerous dependencies and potential troubleshooting steps, particularly for audio and hardware integration.
  • Windows and Linux setups may require additional dependencies beyond those listed for macOS.
Health Check
Last commit

8 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
19 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.