A bilingual EN/FR voice math tutor for Grade 1β3, powered by ElevenLabs.
Live demo: mathvoice-web.vercel.app
MathVoice runs entirely in the browser. No app to install. No downloads. ElevenLabs voices the questions. The Web Speech API listens for answers. The child speaks. MathVoice responds.
β οΈ Chrome only. The Web Speech API used for microphone input is not supported in Firefox or Safari. Open in Chrome for the full experience.
β οΈ Credit limit. The live demo runs on a free-tier ElevenLabs API key with limited monthly credits. If voice output is silent, credits may be exhausted β the app falls back to browser TTS automatically. To run with your own key, see Deploy to Vercel below.
User hits Start
β
Browser requests microphone permission
β
ElevenLabs TTS voices the greeting (eleven_multilingual_v2)
β
ElevenLabs TTS voices the math question
β
7-second countdown ring β reflection time
β
2-second capture window β mic active, Web Speech API listens
β
Answer parsed β compared β ElevenLabs TTS voices feedback
β
Repeat for 5 questions β voiced score summary
The mic is only active during the 2-second capture window. This keeps credit usage minimal and reduces false triggers.
- Choose English or French
- Choose your grade (1, 2, or 3)
- Hit Start β browser asks for mic permission, then MathVoice greets you
- Listen to the question, watch the 7-second countdown
- Say your answer when you see the π€ icon
- Get instant voiced feedback β encouragement or gentle correction
- 5 questions, then a voiced score summary
Browser
βββ ElevenLabs REST API β TTS voice output
β βββ eleven_multilingual_v2, EN + FR
βββ Web Speech API β Speech-to-text input (browser native)
βββ 2-second active capture window per question
No backend. No database. Stateless session.
API key lives client-side (NEXT_PUBLIC_). See security note below.
Graceful fallback: If no API key is set or credits are exhausted, MathVoice falls back to the browser's built-in Web Speech synthesis β lower voice quality but fully functional.
Security note: For this demo, the ElevenLabs API key is client-side (NEXT_PUBLIC_). For a production deployment, proxy TTS requests through a Next.js API route (/api/tts) to keep the key server-side and rate-limit by user.
Step 1 β Fork or clone
git clone https://github.com/Moezusb/mathvoice-web.git
cd mathvoice-webStep 2 β Import on Vercel
- Go to vercel.com/new
- Import your GitHub repo
- Under Environment Variables, add:
- Key:
NEXT_PUBLIC_ELEVENLABS_API_KEY - Value: your ElevenLabs API key (get one here)
- Grant Text to Speech β Access only β no other permissions needed
- Key:
- Click Deploy
Vercel auto-detects Next.js. No build configuration required.
npm install
cp .env.local.example .env.local
# Add your ElevenLabs API key to .env.local
npm run devOpen http://localhost:3000 in Chrome.
| Grade | Operations | Range |
|---|---|---|
| 1 | Addition, subtraction | Numbers 1β20 |
| 2 | Addition, subtraction, multiplication (Γ2, Γ5, Γ10) | Up to 100 |
| 3 | All operations | Multiplication up to 10Γ10 |
Voice quality is the product for a child learning to listen and respond. Robotic TTS breaks engagement in seconds. ElevenLabs' eleven_multilingual_v2 model delivers:
- Natural pacing and warmth β children lean in rather than tune out
- Native-quality French β not translated English with a French accent
- Emotional expressiveness β encouragement sounds like encouragement
The bilingual EN/FR capability reflects a real deployment need: French-first learners in Quebec, West Africa, and across the Francophone world deserve the same quality of voice interaction as English-speaking children.
Mohamed Bah β moezusb.github.io Β· LinkedIn
"Great science is artistic at its core."
