Skip to content

Derrick-MUGISHA/Max_Ai_Robot

Repository files navigation

๐ŸŽค Kinyarwand/English Voice Assistant A bilingual voice assistant that understands and speaks both Kinyarwanda and English. Talk to it naturally and it will respond in your language! ๐ŸŒŸ Features

๐Ÿ—ฃ๏ธ Bilingual Speech Recognition - Understands Kinyarwanda and English ๐Ÿ”Š Text-to-Speech - Responds in both languages ๐Ÿค– AI-Powered - Uses Google Gemini or works offline ๐ŸŽฏ Wake Words - Activate with "muraho", "hey", "ese", etc. โฐ Smart Responses - Time, date, weather, and conversation

๐Ÿš€ Quick Start

  1. Install Requirements bashpip install google-generativeai SpeechRecognition gTTS playsound pyaudio
  2. Get Free API Key

Go to Google AI Studio Sign in with Google account Create API key Copy the key

  1. Update Code Replace "YOUR-GEMINI-API-KEY-HERE" with your actual API key
  2. Run Assistant bashpython main.py ๐ŸŽฏ How to Use Wake Words (to activate):

English: "hey", "assistant", "derrick", "max" Kinyarwanda: "ese", "muraho"

Example Conversations: English:

"Hey, what time is it?" "Assistant, how are you?" "What's the weather today?"

Kinyarwanda:

"Muraho, ni iki gihe?" "Ese, ute?" "Amakuru yawe?"

Exit Commands:

Say "stop" or "hagarara" to quit

๐Ÿ“ฆ Installation Options Option 1: Google Gemini (Recommended) bashpip install google-generativeai SpeechRecognition gTTS playsound pyaudio

โœ… Most powerful AI responses โœ… Free API (with limits) โœ… Best language understanding โŒ Needs internet connection

Option 2: Offline AI bashpip install transformers torch SpeechRecognition gTTS playsound pyaudio

โœ… Works without internet โœ… Private (no data sent anywhere) โŒ Large download (~1-2GB) โŒ Slower responses

Option 3: Simple Offline bashpip install SpeechRecognition gTTS playsound pyaudio

โœ… Lightweight and fast โœ… No API keys needed โœ… Basic conversations work well โŒ Limited to predefined responses

๐Ÿ”ง Troubleshooting Microphone Issues bash# Windows: Install PyAudio properly pip install pipwin pipwin install pyaudio

Check microphone permissions in Windows Settings > Privacy > Microphone

OpenAI API Errors bash# Switch to Gemini instead pip install google-generativeai

Update code to use Gemini version

Speech Recognition Problems

Speak clearly and close to microphone Check internet connection (needed for speech recognition) Try adjusting microphone volume in system settings

๐Ÿ“ File Structure voice-assistant/ โ”œโ”€โ”€ main.py # Gemini-powered version โ”œโ”€โ”€ offline.py # Offline AI version
โ”œโ”€โ”€ simple_offline.py # Simple responses version โ”œโ”€โ”€ requirements.txt # Dependencies โ””โ”€โ”€ README.md # This file ๐ŸŽฎ Commands You Can Try Time & Date

"What time is it?" / "Ni iki gihe?" "What's today's date?" / "Uyu munsi ni uwihe?"

Greetings

"Hello" / "Muraho" "Good morning" / "Mwaramutse" "How are you?" / "Ute?"

General Chat

"Thank you" / "Urakoze" "What's your name?" / "Amazina yawe ni ayahe?" "Help me" / "Nfasha"

๐ŸŒ Language Support The assistant automatically detects which language you're speaking:

Input: Kinyarwanda or English Output: Responds in the same language Fallback: If Kinyarwanda TTS fails, uses English voice Recognition: Tries Kinyarwanda first, then English

๐Ÿ’ก Tips for Best Results

Speak Clearly - Pause briefly between wake word and command Use Wake Words - Always start with a wake word Internet Required - For speech recognition and Gemini API Quiet Environment - Reduces background noise interference Good Microphone - Built-in laptop mics work, but external is better

๐Ÿ†˜ Common Issues & Solutions ProblemSolution"ModuleNotFoundError"Run pip install [module-name]"API key invalid"Check Gemini API key is correct"Microphone not found"Check Windows microphone permissions"No speech detected"Speak louder or closer to microphone"Can't understand speech"Try speaking in English first ๐ŸŽฏ Next Steps Once you have it working:

Customize Wake Words - Add your name or preferred phrases Add More Languages - Modify language codes for other languages Extend Responses - Add more conversation topics Improve Audio - Use better microphone for clearer recognition

๐Ÿ“ž Need Help? If you're stuck:

Try the Simple Offline version first (easiest to get working) Check microphone permissions in Windows Settings Make sure you have internet connection Verify API key is correct

Mwiriwe neza! Good luck with your voice assistant! ๐ŸŽ‰

About

the personal assistanen ai that assit you both on and offline

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages