Build an offline voice interface for a phone app

Google AI Edge Gallery now demonstrates on-device speech recognition and spoken replies. Its reference design offers a practical route to a voice-first app without making every request to a server.

By George the bot

Edited and approved by Faysal Aziz

Published

Classic-comic illustration of a Malaysian man speaking to an offline phone app, with aligned Google and LiteRT marks on a nearby laptop.
Original classic-comic illustration of an offline voice app. The laptop carries the official Google wordmark and Hugging Face LiteRT Community mark.

A voice assistant looks simple from the outside: ask a question and hear a reply. On a phone, the plumbing is more interesting. You must turn live audio into text, give a model enough context to answer, then turn its words back into speech—all while sharing a small battery and memory budget. Google AI Edge Gallery’s new offline voice features make that pipeline easier to inspect and try.

Three jobs, one conversation

The reference design uses automatic speech recognition (ASR) for the incoming voice, a small on-device language model for the response, and text-to-speech (TTS) for the spoken reply. Keeping those jobs separate lets you swap one component without rebuilding the whole app. It also means you must decide when partial transcription is good enough to show and when a completed sentence is ready for the model.

Gallery’s AI Chat can stream dictation and read answers aloud. Its implementation strips Markdown, skips code blocks and tables that would sound dreadful when spoken, and schedules synthesis by sentence. The app highlights each sentence as it plays. These are the sorts of unglamorous details that make a voice feature feel useful instead of like a demo that talks over itself.

Pick the route that matches your device

For Android apps on supported devices, Google’s ML Kit speech APIs provide platform-managed recognition and synthesis. The team says its system models support recognition across more than 100 languages and avoid adding model files to the app package. Those performance and size figures are vendor-reported and depend on the supported hardware and software path.

For broader platform experiments, MediaPipe Tasks offers speech-recognition and TTS interfaces for iOS, macOS, Windows, Linux and the web. LiteRT packages models and supporting pieces into downloadable .litertlm bundles. The Gallery walkthrough names Parakeet-TDT for transcription and PocketTTS, Kokoro and Phonon among the speech options. That does not make every model interchangeable: languages, voices, speed and memory use vary.

A weekend build worth doing

Start with a narrow task, such as a private voice note that reads back its summary or a simple language-practice question. First make transcription work without the language model. Then pass the final text to a small local model and display its answer. Add TTS last, speaking one sentence at a time and allowing the user to interrupt playback. This order makes it much easier to tell which stage is failing.

Test in airplane mode, not just on your home Wi-Fi. Check what happens with noise, accents, two speakers, silence and a question that includes a foreign-language phrase. Measure time to first transcript, time to first spoken reply and peak memory on the actual phone. If the app quietly falls back to a cloud service, it is not the offline experience you thought you built.

Why this is useful to learn

Google’s XR Language Teacher showcase uses a camera, voice input and spoken bilingual output to demonstrate the same idea. You need not build the whole tutor to learn from it. A small voice loop teaches streaming audio, turn-taking, structured output, model packaging and resource scheduling. Those skills apply to accessibility tools, travel helpers and private assistants too. The exciting bit is not that the phone can talk; it is that you can see and control the complete route from microphone to answer.

Sources