[PAID] LocalVoice: On-Device Voice Assistant | Offline Speech Recognition & Voice Synthesis ($6 or INR 421)

LocalVoice Extension

Bring true on-device voice capabilities directly to your app — 100% offline! This extension gives your Android apps both Speech-to-Text (Voice Recognition) and Text-to-Speech (Voice Synthesis) without requiring any internet connection. Build conversational voice assistants, voice typers, or talking apps without worrying about API keys, monthly cloud bills, or latency.

Key Features:

  • 100% Offline & Private: Everything runs directly on the device CPU. Audio and microphone recordings never leave the user’s phone.
  • Real-time Live Dictation: Speak into the microphone and receive instant words and partial transcriptions as you speak, with automatic speech pause detection.
  • Audio File Recognition: Transcribe pre-recorded audio files (.mp3, .m4a, .wav, .ogg, .flac) directly from assets or storage with live progress.
  • Natural-Sounding Voices: Speak any text out loud with fluid, natural human voices. Includes gapless streaming so speech starts playing almost instantly without long awkward pauses.
  • Popular Model Support: Works with standard offline voice models including Whisper, Moonshine, SenseVoice, Piper, and Kokoro in multiple languages (English, Hindi, Spanish, French, German, Chinese, and more).
  • Multi-Voice & Speed Control: Adjust voice speed and switch between different male/female character voice styles effortlessly.

Thanks to @Anke for the extension idea. :smiley:


1. Overview

Version: 1
Released: November 07, 2026
Permissions: android.permission.RECORD_AUDIO (for microphone speech recognition)

Aix Size: 108 KB
(Note: Requires adding liblocalvoice-arm64.zip or liblocalvoice.so into your project’s assets)

2. Blocks






3. Documentation

LocalVoice

NativeReadyEvent raised when the native voice engine library has been loaded and initialized successfully.
NativeFailedEvent raised when loading or initializing the native voice engine library fails.
message : text
STTModelReadyEvent raised when the STT speech-to-text model is successfully loaded and ready for recognition.
STTModelFailedEvent raised when loading the STT model or speech recognition fails.
message : text
EndpointDetectedEvent raised when an endpoint (pause/end of utterance) is detected during live speech recognition.
TTSModelReadyEvent raised when the TTS text-to-speech model is successfully loaded and ready for speech synthesis.
TTSModelFailedEvent raised when loading the TTS model fails.
message : text
PartialResultEvent raised during live recognition with real-time partial transcription text.
text : text
FinalResultEvent raised when speech recognition is completed with the final recognized text.
text : text
SpeechReadyEvent raised when Speak generates a speech audio WAV file successfully, providing the file path.
filePath : text
SpeechFailedEvent raised when TTS speech synthesis or playback fails.
message : text
PlaybackStartedEvent raised when SpeakAndPlay begins playing synthesized audio.
PlaybackDoneEvent raised when SpeakAndPlay completes playing synthesized audio.
DownloadProgressEvent raised periodically during model download with progress percentage (0-100). Negative value indicates KB downloaded when content length is unknown.
percent : number
DownloadCompletedEvent raised when model archive download finishes and is extracted to the given directory path.
path : text
DownloadFailedEvent raised when downloading or extracting the model archive fails.
message : text
LoadNativeLibraryLoads the native voice engine library from app assets (e.g. //liblocalvoice.so or //liblocalvoice-arm64-v8a.zip) or an absolute file path.
path : text
DownloadModelDownloads and extracts a model zip or tar archive from the specified URL into app storage.
url : text
LoadSTTModelLoads an offline STT model from the specified directory path. Supports Moonshine, Whisper, Zipformer, Paraformer, CTC, etc.
modelDir : text
LoadSTTModelAdvancedLoads an STT model using a custom key-value dictionary of Sherpa-ONNX configuration properties.
configProps : dictionary
LoadTTSModelLoads an offline TTS model from the specified directory path. Supports Piper (VITS) and Kokoro.
modelDir : text
LoadTTSModelAdvancedLoads a TTS model using a custom key-value dictionary of Sherpa-ONNX configuration properties.
configProps : dictionary
StartListeningStarts live microphone recording and real-time speech recognition. Make sure RECORD_AUDIO permission has been granted.
StopListeningStops live microphone recording and triggers FinalResult with recognized speech text.
RecognizeFilePerforms speech recognition on an audio file (e.g. .wav, .mp3, .m4a, .ogg, .flac) from assets (//file.mp3), content URI, or file path. Raises PartialResult as recognition progresses, and FinalResult when complete.
filePath : text
UnloadSTTModelUnloads the currently loaded STT model to free memory.
SpeakSynthesizes text into a speech WAV audio file asynchronously. Raises SpeechReady when finished.
text : text
SpeakAndPlaySynthesizes text to speech and plays the generated audio directly through the device speaker.
text : text
StopPlaybackStops active speech synthesis and audio playback immediately.
UnloadTTSModelUnloads the currently loaded TTS model to free memory.
CancelCancels active tasks including model downloads, live recording, and speech synthesis.
STTModelTypeSets the STT model type manually (e.g. transducer, moonshine, whisper, paraformer, ctc, turing). If empty, auto-detected from model files.
Accepts: text
TTSModelTypeSets the TTS model type manually (e.g. vits, piper, kokoro, matcha). If empty, auto-detected from model files.
Accepts: text
SpeechSpeedSets the TTS speech synthesis speed factor (default: 1.0).
Accepts: number
SpeakerIDSets the multi-speaker voice ID for TTS models with multiple voices (default: 0).
Accepts: number
STTThreadsSets the number of CPU threads used for STT inference (0 for auto).
Accepts: number
TTSThreadsSets the number of CPU threads used for TTS synthesis (0 for auto).
Accepts: number
IsNativeLoadedReturns true if the native voice engine library is successfully loaded.
Accepts: boolean
IsSTTModelLoadedReturns true if an STT model is loaded and ready for recognition.
Accepts: boolean
IsTTSModelLoadedReturns true if a TTS model is loaded and ready for speech synthesis.
Accepts: boolean
IsListeningReturns true if currently listening/recording audio for live STT.
Accepts: boolean
IsSpeakingReturns true if currently synthesizing or playing TTS audio.
Accepts: boolean
IsDownloadingReturns true if a model download is in progress.
Accepts: boolean
TTSSampleRateReturns the native audio sample rate of the loaded TTS model in Hz.
Accepts: number

4. Example Usage

Step 1: Initialize the Native Engine
Before performing any voice operations, you must load the native engine library. Call the LoadNativeLibrary block and pass the asset path to your binary zip or library file (e.g., //liblocalvoice-arm64.zip or //liblocalvoice.so). The extension will automatically unpack and link the library in the app’s private storage.
Important: Always wait for the NativeReady event to fire before attempting to download or load any voice model!



Step 2: Download a Voice Model (STT or TTS)
Once the native engine is ready, you need a model to run. Use the DownloadModel block with a direct URL to a .tar.bz2 or .zip model archive. The extension will automatically download and extract it into your app’s private directory (and skip downloading if the model folder already exists).

Use the DownloadProgress event to display a progress bar or percentage on your screen.


Step 3: Load the Model into Memory
When the model download and extraction finishes, the DownloadCompleted event will fire and provide the local directory path on the device.
Pass this path directly to:

  • LoadSTTModel for speech recognition models. Wait for the STTModelReady event.
  • LoadTTSModel for text-to-speech voice models. Wait for the TTSModelReady event.

The extension automatically detects whether your model is Whisper, Moonshine, Zipformer, Piper, or Kokoro.


Step 4: Live Speech-to-Text & Audio Transcription

  • Live Microphone Recognition:
    Call StartListening to begin listening. As the user talks, the PartialResult event fires continuously with live subtitles. When the user stops talking, EndpointDetected fires, and calling StopListening will trigger FinalResult with the complete transcribed sentence.
    (Make sure RECORD_AUDIO permission has been granted).
  • File Transcription:
    Have an audio recording or voice memo? Call RecognizeFile with an asset path (e.g., //sample.mp3), file path, or content URI. The extension supports WAV, MP3, M4A, OGG, and FLAC, firing PartialResult as it transcribes and FinalResult when finished.


Step 5: Instant Text-to-Speech (TTS)

  • Speak and Play Aloud:
    Call SpeakAndPlay with your text (e.g., "Hello! How can I assist you today?"). The extension uses real-time clause streaming to begin playback through the device speaker with virtually zero latency.
    • PlaybackStarted fires as soon as sound begins playing.
    • PlaybackDone fires when playback finishes.
  • Save Speech to File:
    Call Speak to synthesize the text into an offline .wav audio file in app cache. When finished, the SpeechReady event returns the full file path.
  • Voice Customization:
    • Set SpeechSpeed to adjust playback rate (e.g., 0.85 for slower, 1.2 for faster).
    • Set SpeakerID (e.g., 0, 1, 2…) to choose different voices in multi-speaker models like Kokoro.


Step 6: Freeing Memory & Canceling

  • Call UnloadSTTModel or UnloadTTSModel when switching screens or tasks to immediately free device RAM. The native library stays loaded so you can quickly load another voice model.
  • Call Cancel at any time to instantly cancel an active download, live listening session, or speech synthesis task.

5. Demo Video

https://youtube.com/shorts/iyYeNgKV6bc

6. Purchase Extension

UPI id: vknow360@apl

Thank you.
Hope it helps!

4 Likes