Opt-in wake word: on-device keyword spotting in a microphone foreground service
CI / check (push) Canceled after 0s

- Engine: sherpa-onnx 2.0.1 keyword spotter (Apache-2.0) with the English
  zipformer-gigaspeech-3.3M KWS model (Apache-2.0, int8), fetched hash-pinned by
  scripts/fetch-wakeword.py into app/libs and src/full/assets (gitignored); CI and release run it.
  `full` flavour only (abiFilters arm64-v8a, armeabi-v7a, x86_64); `fdroid` has a stub engine
  and Settings says why. ProGuard keeps com.k2fsa.sherpa.onnx (JNI reads fields by name).
- WakeWordService (foregroundServiceType microphone): persistent notification with Stop; audio
  only to the engine in memory; pauses while the sheet is up (AssistPresence), in battery saver,
  and with the screen off unless Settings says otherwise. On the word: the sheet opens listening
  through LembasAssistService.showSession when LLeMbas is the assistant, else the activity,
  else a "tap to ask" notification.
- No microphone service at boot: WakeBootReceiver posts "tap to listen again"; MainActivity
  restarts a service the phone stopped.
- Settings › Assistant › Wake word: switch (off), four built-in English phrases (BPE-tokenized
  with the model's bpe.model), screen-on only, battery-optimisation page; privacy and cost text.
- The sheet's "no wake word" line now points at the setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Opus 5.5 committed 2026-11-10 16:27:51 +00:00
1 parent 2080f0b67e
commit dc642c62b9
31 files changed
+1181 -22

No files matched your search

+22 -1
View File
@@ -404,7 +404,6 @@ STRINGS: dict[str, str] = {
"assist_quick_explain_prompt": "Explain what is on my screen.",
"assist_continue": "Continue the last chat",
"assist_help": "Hold the power button to open the assistant over any app, or use the Quick Settings tile.",
"assist_no_wake_word": "There is no wake word: on stock Android, listening for one is kept for the assistant built into the phone.",
"assist_connecting": "Connecting…",
"assist_offline": "%1$s cannot be reached",
"assist_no_model": "No model",
@@ -423,6 +422,28 @@ STRINGS: dict[str, str] = {
"assist_stop_words": "stop|that's all|that is all|that's it|goodbye|bye|enough|end|thank you that's all|cancel",
"assistant_conversation": "Keep a spoken conversation going",
"assistant_conversation_line": "After a spoken answer is read aloud, the assistant listens again — until you say “stop”, tap End, or say nothing for a few seconds. Works with a headset.",
"assist_wake_word_hint": "No wake word unless you want one: Settings › Assistant › Wake word turns on LLeMbas's own, on this phone.",
"channel_wake": "Wake word",
"wake_word": "Wake word",
"wake_word_listen": "Listen for a wake word",
"wake_word_line": "Off by default. Say the phrase and the assistant opens, listening, over whatever app is on screen.",
"wake_word_unavailable": "Not in this build. The F-Droid build has no wake-word engine, because F-Droid builds every library from source; the build from llembas.eu has one.",
"wake_screen_only": "Only while the screen is on",
"wake_screen_only_line": "Off: it listens with the screen off too, at more cost to the battery.",
"wake_battery": "Let it run in the background",
"wake_battery_line": "Some phones (Samsung, Xiaomi, Huawei, OnePlus and others) stop background apps to save battery, and the wake word with them. Exempt LLeMbas from battery optimisation here; dontkillmyapp.com explains your phone's own settings.",
"wake_word_privacy": "Nothing leaves the phone before the word. The microphone's sound goes only to the wake-word engine on the phone and is not kept, and the notification stays up the whole time it listens. The phrases are English; the engine is sherpa-onnx (open source).",
"wake_word_cost": "It costs battery: the microphone stays on and the phone's processor checks every moment of sound, without the low-power chip the built-in assistant uses. It pauses in battery saver, while the assistant is open and, unless you change it, with the screen off. After a restart, tap its notification to start it again.",
"wake_listening_for": "Listening for “%1$s”",
"wake_notification_line": "Nothing leaves the phone until you say it.",
"wake_paused_screen": "Wake word paused: the screen is off",
"wake_paused_battery": "Wake word paused: battery saver is on",
"wake_paused_assistant": "Wake word paused while the assistant is open",
"wake_paused_microphone": "Wake word paused: the microphone or the engine is not available",
"wake_stop": "Stop listening",
"wake_heard": "Heard you. Tap to ask.",
"wake_resume": "Listen for the wake word again",
"wake_resume_line": "The phone restarted. Tap to start listening again.",
"assist_recogniser_failed": "The phone's speech recogniser stopped. Try again, or choose LLeMbas under Settings › Voice input.",
"assistant_listens": "Start listening when the assistant opens",
"voice_input": "Voice input",