Building an Offline Voice Note App for Telugu, Hindi, English
Most voice note apps send your audio to a server. For personal conversations, that is a poor trade, and for Indian speech it is often a poor result as well: people here switch between Telugu, Hindi and English inside a single sentence, and many transcription services handle that badly. I am building AIIR to address both problems. It records voice notes, transcribes them and turns them into structured notes with a title, a summary and action items, all on the device.
Why I built it
I wanted a note-taker for the way people actually talk in Hyderabad and across India: Telugu, Hindi and English, often mixed mid-thought. I also did not want recordings of private conversations leaving the phone. Those two requirements point to the same design: run the speech and language models locally, and make it impossible for the app to talk to the network.
I build and test on a Samsung Galaxy Z Fold 7. AIIR is an active project, developed phase by phase, so parts of it are finished and parts are not. I will be clear about which is which below.
What it does
- Records voice notes and stores them encrypted.
- Plays recordings back.
- Is designed to transcribe Telugu, Hindi and English, including code-switched speech.
- Is designed to generate a title, summary and action items for each note.
Phases 1 and 2 are done: the multi-module project, audio capture, encrypted storage, the encrypted database and the Compose UI, verified on the device. Phase 3, real offline transcription with whisper.cpp, is in progress. Phase 4, note generation with llama.cpp, is planned, followed by foldable-specific layouts, Hindi and Telugu UI strings, and accuracy and latency testing on a real device.
Right now transcription and summaries come from placeholders: a stub transcription engine and a heuristic note engine. That is deliberate, and I explain why in the lessons section.
How it works
Module layout
The project is split into Gradle modules:
:appholds the Compose UI, navigation and Koin dependency injection wiring.:core-modelholds dependency-free domain models and the engine interfaces.:core-dataholds Room, SQLCipher and the repositories.:core-audiohandles AudioRecord capture, WAV encoding, encrypted storage and Media3 playback.:core-asris the speech-to-text engine, using whisper.cpp through JNI (in progress).:core-llmis the note-intelligence engine, using llama.cpp through JNI (planned).
The native sources for whisper.cpp and llama.cpp are vendored as separate git submodules rather than shared. Each library moves quickly, and keeping them separate lets each module track its own upstream on its own schedule.
The recording pipeline
AudioRecord captures 16 kHz mono PCM16, which is the native input format for whisper.cpp. Because the capture format already matches, there is no resampling step anywhere in the pipeline.
There is one awkward detail. A WAV header needs the total data length up front, but a streaming cipher cannot be rewound to patch the header afterwards. So the raw capture first goes to an unencrypted scratch file. When recording stops, the audio is wrapped in a proper WAV header and streamed through a Tink StreamingAead cipher into permanent encrypted storage, and the scratch file is deleted.
Privacy by construction
- No INTERNET permission. The manifest does not request it, so the operating system enforces offline behaviour. No code path in the app can open a network socket.
- Audio at rest. Encrypted with Tink using a hardware-backed Android Keystore key.
StreamingAeadencrypts in bounded 4 KB chunks, so whole recordings are never buffered in memory. - Database at rest. Room runs on SQLCipher rather than plaintext SQLite, so transcripts are encrypted as well as audio. The SQLCipher passphrase is generated randomly once and wrapped by the Keystore through Tink, which gives one security model for both audio and database.
- Backups off.
android:allowBackupis false, so recordings and transcripts are not swept into Android auto-backup.
The models
For speech-to-text I plan to use whisper.cpp with Whisper large-v3-turbo, quantized. For note generation I plan to use llama.cpp with Gemma 4 E4B-it, quantized, with GBNF grammar-constrained output so the model returns valid JSON that the app can parse reliably. The rest of the stack is Kotlin 2.3, Jetpack Compose with Material 3, Koin, Room 2.8, Media3, and Android Gradle Plugin 9.3 with its built-in Kotlin support.
What I learned
Put the hard part behind an interface first. The ML integration is the heaviest work in the project. Rather than block everything on it, I defined TranscriptionEngine and NoteIntelligenceEngine in :core-model and wrote stub and heuristic implementations. That let me build and verify recording, storage, the database and the UI independently. When the real engines land, the rest of the app should not need to change.
Choose formats to match your model. Recording at 16 kHz mono PCM16 removes a whole class of resampling code and bugs, because it is what Whisper expects.
Streaming encryption has constraints. A cipher you cannot rewind forces a design decision about when to write headers. A short-lived scratch file solved it, at the cost of briefly holding unencrypted audio on disk before it is encrypted and deleted. That is a trade-off worth stating plainly.
Enforce privacy with the platform, not with promises. Leaving out the INTERNET permission is a stronger guarantee than any policy statement, because it can be checked in the manifest.
Reuse one key strategy. Wrapping the database passphrase with the same Keystore and Tink setup as the audio keeps the security model small enough to reason about.
Conclusion
AIIR is unfinished, and I would rather say so than imply otherwise. The recording, encryption and storage pipeline works on the device. Real transcription and note generation are the next phases, and accuracy on code-switched Telugu, Hindi and English is something I still have to measure on real hardware. The architecture is set up so those pieces can be swapped in without disturbing the rest, and I will write up the results once they are tested.