shiloht1/speach_ai

0

stars

0

commits

Python

primary language

Feb 16, 2025

updated

README

Speech AI Assistant

An interactive AI assistant that can understand speech, generate responses, and speak back using text-to-speech.

Features

  • Speech Recognition using Facebook's Wav2Vec2 model
  • Text Generation using TinyLlama-1.1B-Chat
  • Text-to-Speech using pyttsx3
  • Real-time conversation capabilities

Requirements

  • Python 3.12+
  • Windows (for pyttsx3 text-to-speech)
  • Internet connection (for downloading models)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/speech_ai.git
cd speech_ai
  1. Create a virtual environment:
python -m venv nemo_env
  1. Activate the virtual environment:
# On Windows:
nemo_env\Scripts\activate
  1. Install dependencies:
pip install numpy torch transformers pyaudio sounddevice pyttsx3

Usage

  1. Make sure you're in the project directory with the virtual environment activated

  2. Run the assistant:

python integrated_assistant.py
  1. Once running:
    • Press Enter to start recording (speak for 5 seconds)
    • The system will:
      • Convert your speech to text
      • Generate an AI response
      • Speak the response back to you
    • Press 'q' and Enter to quit

Technical Details

  • Speech Recognition: Uses Facebook's wav2vec2-base-960h model
  • Text Generation: Uses TinyLlama-1.1B-Chat model
  • Audio: Uses PyAudio for recording and pyttsx3 for text-to-speech
  • Default recording duration: 5 seconds
  • Sample rate: 16000 Hz

File Structure

  • integrated_assistant.py: Main application file
  • requirements.txt: Python package dependencies
  • README.md: Documentation

Common Issues

  1. PyAudio installation errors:

    • If you get an error installing PyAudio, download and install it from a precompiled wheel:
    • Visit PyAudio Wheels
    • Download the appropriate version for your Python
    • Install with: pip install PyAudio‑X.X.X‑cpXX‑cpXX‑win_amd64.whl
  2. Text-to-Speech not working:

    • Ensure you have Windows SAPI5 voices installed
    • Check Windows Speech settings

License

MIT License

shiloht1/speach_ai

0

stars

0

commits

Python

primary language

Feb 16, 2025

updated

README

Speech AI Assistant

An interactive AI assistant that can understand speech, generate responses, and speak back using text-to-speech.

Features

  • Speech Recognition using Facebook's Wav2Vec2 model
  • Text Generation using TinyLlama-1.1B-Chat
  • Text-to-Speech using pyttsx3
  • Real-time conversation capabilities

Requirements

  • Python 3.12+
  • Windows (for pyttsx3 text-to-speech)
  • Internet connection (for downloading models)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/speech_ai.git
cd speech_ai
  1. Create a virtual environment:
python -m venv nemo_env
  1. Activate the virtual environment:
# On Windows:
nemo_env\Scripts\activate
  1. Install dependencies:
pip install numpy torch transformers pyaudio sounddevice pyttsx3

Usage

  1. Make sure you're in the project directory with the virtual environment activated

  2. Run the assistant:

python integrated_assistant.py
  1. Once running:
    • Press Enter to start recording (speak for 5 seconds)
    • The system will:
      • Convert your speech to text
      • Generate an AI response
      • Speak the response back to you
    • Press 'q' and Enter to quit

Technical Details

  • Speech Recognition: Uses Facebook's wav2vec2-base-960h model
  • Text Generation: Uses TinyLlama-1.1B-Chat model
  • Audio: Uses PyAudio for recording and pyttsx3 for text-to-speech
  • Default recording duration: 5 seconds
  • Sample rate: 16000 Hz

File Structure

  • integrated_assistant.py: Main application file
  • requirements.txt: Python package dependencies
  • README.md: Documentation

Common Issues

  1. PyAudio installation errors:

    • If you get an error installing PyAudio, download and install it from a precompiled wheel:
    • Visit PyAudio Wheels
    • Download the appropriate version for your Python
    • Install with: pip install PyAudio‑X.X.X‑cpXX‑cpXX‑win_amd64.whl
  2. Text-to-Speech not working:

    • Ensure you have Windows SAPI5 voices installed
    • Check Windows Speech settings

License

MIT License

Languages

Python

100.0%