A Kinyarwanda voice assistant
# π£οΈ Kinyarwanda Voice Assistant
A bilingual voice interaction tool utilizing Whisper for transcribing speech and TTS for generating speech from text. It includes an intuitive Gradio interface featuring two functional tabs: voice-based Q&A and custom TTS synthesis.
---
## π§ Key Functionalities
- ποΈ **Automatic Speech Recognition** powered by Whisper.
- π¬ **Kinyarwanda-based Question Answering** from preset responses.
- π **Text-to-Speech Synthesis** using models from Hugging Face.
- π₯οΈ **Interactive Web UI** built with Gradio.
- π **Speaker Cloning** using reference audio files.
- π **Launchable Web Interface** with optional public sharing.
---
## π οΈ Installation Guide
### βοΈ Python Dependencies
Ensure your Python environment is ready by installing the required libraries:
```bash
pip install -q openai-whisper
pip install numpy==1.24.3 --force-reinstall
pip install gradio
pip install transformers
pip install torchaudio
pip install TTS
pip install nemo-toolkit
Alternatively, install from the requirements file:
bash
Copy
Edit
pip install --no-cache-dir -r /content/drive/MyDrive/kinya-assistant/stt/requirements.txt
π§° Required System Packages
Install sox for audio manipulation:
bash
Copy
Edit
apt-get update && apt-get install -y sox libsox-fmt-all
π Getting Started
π€ Using the Voice Assistant
Record your voice or upload an audio file.
Workflow:
Audio is transcribed using Whisper.
Text is matched to predefined Kinyarwanda inputs.
Audio response is generated and played.
π’ Text-to-Speech Module
Input your custom text.
Upload a .wav file as a voice sample.
Select the target language.
The assistant will generate speech and play it.
π§ Behind the Scenes
Loading the Models
python
Copy
Edit
whisper_model = whisper.load_model("small")
hf_model = TTS(model_name="tts_models/en/ljspeech/tacotron2-DDC")
Audio Transcription Process
python
Copy
Edit
def transcribe_audio(audio_path):
waveform, sample_rate = torchaudio.load(audio_path)
...
result = whisper_model.transc β¦