Write to us

AI, Quran apps, Privacy

On-device AI for Quran recitation

How an app can use AI to follow a recording of Quran recitation on your phone alone, match it to a trusted text, and tell you when it is unsure.

An app can use AI to follow a recording of Quran recitation entirely on your phone, so the recording never has to be sent to a server. A speech recognition model running on the phone listens to the audio and produces its best reading of the words. The app then matches that reading against a trusted copy of the Quran text and reports which ayat were recited, with a clear statement of how sure it is. The AI does the listening, while the Quran text itself always comes from a checked source, so the machine never writes a single word of it.

Our own app, Mirtal, works in this way, and we describe what it does today towards the end.

What it means for AI to listen on the phone

Speech recognition is the kind of AI that turns spoken audio into written words. For many years it needed powerful computers in a data centre, which meant that any app offering it had to upload your audio, process it elsewhere and send the result back.

That has changed. Open speech recognition models can be shrunk and tuned until they run on an ordinary phone, using its own processor and memory. The phone takes in the audio, the model works through it piece by piece, and the result appears on the screen without the audio ever leaving the device.

Running on the phone is slower than running on a large server, and it uses more of the phone’s battery while it works. In exchange, it removes the need for an internet connection and for anyone else to receive your recording, and for recordings of recitation we think that exchange is clearly worth making.

Why the recording should never leave your device

A recording of Quran recitation is often personal. It may be a family member reciting at home, a child practising for their teacher, a recording of taraweeh made with the imam’s permission, or a voice note between a student and a Shaykh. People share these recordings with care, and they deserve to know exactly where they go.

When an app uploads a recording for processing, the person loses sight of it. They cannot easily know how long it is kept, who can reach it, or whether it will be used to train some future system. Even with good intentions on all sides, every copy that exists on someone else’s computer is a copy that could be exposed.

An app that processes the recording on the phone avoids all of these questions. If the app also asks for no internet permission, the phone itself makes sure that nothing leaves, and the person can rely on that without having to trust any promise in a policy.

Matching what is heard to a trusted text

A speech model on its own produces its own attempt at the words it heard, and that attempt can contain mistakes, particularly with echo, background noise or a distant microphone. If an app showed that raw attempt as Quran text, it would risk putting words in front of a reader that are not in the Quran at all.

The safe approach is to treat what the model heard as a set of clues and never as the text itself. The app compares those clues against a complete and trusted copy of the Quran, finds the passage that matches best, and then shows the reader the trusted text for that passage. In this way the AI helps to find the place, and the words on the screen are always copied from the source.

Mirtal uses the Quran text from Tanzil, an established open source of the Uthmani text, and it never types or generates any part of it. The same rule is one of the promises behind our Quran Audio Engine work, which states that the Quran text is never generated or changed.

When the AI is unsure, say so

Every speech model makes mistakes, and the honest thing is to admit it. A recording made in a large masjid with strong echo, or from the back of a room, is harder to follow than a clean recording made close to the reciter. Sometimes the model cannot tell which of two similar passages it heard.

An app should never hide that uncertainty, and when it is confident, it can say so. When it is less sure, it should say that too, and when it does not know, it is better to show nothing than to show a wrong answer dressed up as a right one. In our engine work this is written down as a rule that silence beats a wrong answer, and as a promise that an uncertain answer is never shown as exact.

Mirtal shows its confidence alongside what it finds, including when it identifies the parts of a prayer such as Al-Fatihah, the recitation, the takbir and the rak’ahs. Our aim is for every answer to be traceable to the moments in the recording that support it, so that a person can listen again and judge for themselves.

The open tools that make it possible

Much of what makes this possible was built and shared openly by others, and it is right to credit them clearly.

whisper.cpp is an open project, released under the MIT licence, that runs Whisper speech recognition models efficiently on ordinary devices, including phones. Mirtal uses it to do the listening on the phone.

The model Mirtal uses for recitation is a Whisper-based model tuned for Quran recitation and published by Tarteel under the Apache-2.0 licence. A general speech model is trained mostly on everyday speech, so a model tuned for recitation has a far better chance of following the Quran as it is actually recited.

The Quran text comes from Tanzil, released under the Creative Commons Attribution 3.0 licence, which allows the text to be used with credit to its source.

We are grateful for all three. Our own contribution is in how they are put together, in the matching against the text, in the rules about uncertainty, and in the decision that none of it should ever need a connection. We have not chosen a licence for our own engine code yet, so we do not describe it as open source.

What Mirtal does today, and what is still in testing

Mirtal is our app for people who record or collect Quran recitation, such as recordings of taraweeh, masjid prayers or lessons with a teacher. Version 1.4 is in closed testing on Google Play, which means it is open only to invited testers and has no public listing yet.

In that version, you bring in audio or video from your phone, and the original file is never changed. The app analyses the recording on the phone, checking its quality, detecting where there is voice, recognising the speech and aligning it to the Tanzil text. It finds the parts of a prayer and shows how confident it is about each one. You can apply sound presets named Natural, Clear, Distant, Masjid and Custom, which never change the pitch or timing of the recitation. You can clip by ayah or by time and save the result as audio or as video. There is a “Find an ayah” search where you type a reference such as 2:255, and a library with favourites and folders, with the Uthmani text shown alongside English.

Mirtal asks for no internet permission, and it has no account, no adverts and no analytics.

Beyond the app, we are planning the Quran Audio Engine, a family of listening engines built on the same three promises, which are that the text is never generated or changed, recordings never leave the owner’s device through the engine, and an uncertain answer is never shown as exact. Most of its code still lives inside Mirtal, and it remains in planning while we decide how best to share it.