๐ค 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
- Install Requirements bashpip install google-generativeai SpeechRecognition gTTS playsound pyaudio
- Get Free API Key
Go to Google AI Studio Sign in with Google account Create API key Copy the key
- Update Code Replace "YOUR-GEMINI-API-KEY-HERE" with your actual API key
- 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
OpenAI API Errors bash# Switch to Gemini instead pip install google-generativeai
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! ๐