Quran Recitation Checker
Pronunciation Mistake Detection for a Prayer App
My Role
- Compare spoken phonemes with text-derived phonemes
- Align phonemes to graphemes to locate mistakes
- Clean phone audio frame by frame first
Approach at a Glance
Details- 1Audio Preprocessing
- 2Phoneme Recognition
- 3Expected Pronunciation from the Text
- 4Phoneme-to-Grapheme Alignment
- 5Mistakes in the App
Executive Summary
A pronunciation checker for a mobile prayer app. For Muslims, it is important to pronounce prayers exactly as they are written in the Quran. The user recites into their phone, and the app shows where in the text they mispronounced something, so they can correct it.
The system compares what the user said with what the text should sound like:
- an LSTM-based network turns the recording into the sequence of phonemes the user actually pronounced;
- the prayer text is converted into the phonemes it should produce;
- the two sequences are aligned, and every mismatch is marked in the text.
On a test set of recordings with known mistakes, the system detected about 78% of pronunciation mistakes. It works on noisy recordings from ordinary phone microphones, and it shipped in the client's live app. I built the ML part as the only engineer, working with our CEO.
Client Profile
The client builds a mobile prayer app for Muslims. Correct recitation matters: a prayer should be pronounced as it is written in the Quran, and many users, especially those who are learning or who don't speak Arabic natively, can't easily tell when they get a sound wrong. A teacher can, but a teacher isn't there every time someone prays.
Automating that check was hard:
- Arabic phonetics: many mistakes are subtle. Close sounds that differ only slightly change the pronunciation, and recitation has its own rules.
- Phone microphones: recordings come from ordinary smartphones in everyday conditions, with noise and low audio quality.
- Not just "right or wrong": to be useful, the app must show where the mistake is, not only that something was off.
Technical Approach
-
Audio Preprocessing – Recordings are converted with ffmpeg and processed frame by frame with signal processing to improve the quality of low-grade phone audio before recognition.
-
Phoneme Recognition – An LSTM-like neural network (TensorFlow) turns the audio frames into the sequence of phonemes the user actually pronounced.
-
Expected Pronunciation from the Text – The prayer text is converted into the sequence of phonemes it should produce, linking each phoneme back to the letters (graphemes) it comes from.
-
Phoneme-to-Grapheme Alignment – The spoken and expected sequences are aligned, and their similarity is compared position by position. Where they differ, the system knows which sound went wrong and which part of the text it belongs to. Alignment runs on the server and takes a moment, so results arrive shortly after the recording rather than in real time.
-
Mistakes in the App – The result goes back to the mobile app, which marks the mispronounced parts directly in the prayer text.
Business Outcome
The prayer app gained a feature that used to need a teacher: it listens to a recitation and shows exactly where the pronunciation was wrong. On a test set of known mistakes, about 78% were detected, on recordings from ordinary phones. The system was handed over to the client and runs in the live app.
Technologies
Planning something similar?
Tell me about it on a short call. New projects can start within 2 weeks