13

Question

How to force Google Voice Recognition working in offline mode even if an internet connection is available?

Background

I know Google Voice Recognition has an offline mode1, using "speech recognition packs" one can download.2 I'm also aware that this offline-mode is limited, compared to what it can do via Internet. Still, being a little paranoid on Google's data collection I rather avoid using its online facilities – and so I currently don't use Google Voice Search at all.

I'd like to give it a try, though – but always switching to airplane mode for that is not practical. My devices are all rooted, and have the XPosed Framework installed. I know about the GoogleOfflineVoice module – but that hasn't been updated since 9/2014 and is reported to be non-operational with the current Google Search app (plus it's unclear if the dev will pick up the work; I've just asked about that, answer was "Honestly no idea" (dev lacking time)).

Other benefits

It's reported that Google Voice Search is much faster in offline mode. So if one doesn't need the "extended capabilities" of its online mode, faster reaction will certainly be welcome – which makes this question interesting not only for "privacy fetishists", "conspiracy theorists" and "paranoid users" :)

Question (refined):

So I'm looking for alternatives: simple settings preferred, commands definitely accepted, root-solutions are fine. If it requires an app, that app itself should require none or only minimal permissions itself. I'm also open to speech-recognition suggestions not involving Google Voice Search as long as they work offline and don't invade privacy3.

Note:

I'm mainly interested in giving voice commands and maybe doing some dictation.

Related information


1: see: How to use speech-to-text offline?
2: see Google Voice Search requiring internet access even when offline speech recognition pack is installed
3: Internet permission just to download voice-packs is OK, as I can block it as soon as the download is completed. Manual download (placing the files on the SD card) preferred :)

8
  • 3
    What I've found thus far indicates that any third-party apps ought to set the android.speech.extra.PREFER_OFFLINE extra to get this behavior. I'm looking into how a user might control it. Blocking the IP range does not seem to be feasible since it overlaps with other Google services like the Play Store. – Matthew Read May 26 '16 at 5:37
  • Hmm, something is broken. Voice Search was originally working for me offline (limited as you mention) but now it refuses to work at all, just saying "Can't reach Google at the moment." – Matthew Read May 26 '16 at 6:59
  • @MatthewRead Maybe that's the reason GoogleOfflineVoice stopped working: Exactly the same error was reported on that. So it's not the module broken, but Voice Search. Yuck. // BTW: Thanks for the edit! – Izzy May 26 '16 at 8:48
  • 2
    Raw idea of a work-around: 1) block the INTERNET permission of the Voice app (whichever that is). Probably won't work as it will utilize Google Play Services I'm afraid. 2) Using a firewall app to block the specific servers. That would require to know which servers that are. If that triggers something for one of you, a solution on that path would be nice to know as well :) – Izzy Oct 19 '16 at 14:34
  • Looks like there is no solution for this (2 years later) – distante Feb 21 '18 at 19:34
2

I have been able to block the shady online service and force offline mode (for termux-speech-to-text) by identifying the user which (only) runs the offending googlequicksearchbox processes (from a root shell):

# /system/bin/ps -Awo uname,cmdline | grep -m1 -E " com\.google\.android\.googlequicksearchbox:search$" | cut -d" " -f1
u0_a41

(note: I specified Android's built-in ps path to avoid conflicts with other user-installed versions of ps which don't take the same parameters - ie. on Termux)

...and adding a firewall rule to block all outgoing traffic for this user's processes:

# iptables -A OUTPUT -m owner --uid-owner u0_a41 -j DROP

(this rule will go away after rebooting or running the same command with -D instead of -A)

New contributor
Arnau C. is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • Nice idea! One could use AFWall+ (or an init.d script) to persist that rule. Could you please include why exactly that user/app is the one to be blocked? Is there e.g. some documentation saying this app is providing the voice-recognition functionality? – Izzy 13 hours ago
0

I have examined this issue and found the following to be true:

Google's Android OS seems to be configured to send all voice recognition tasks to the "cloud", as there are no provisions in the OS to allow for hardware voice processing, even if your device supposidly supports this nonexistent feature.

In other words, Google has taylored their Android OS to send all voice commands to their "cloud". This provides them with the ability to constantly update a user's voice profile with every command by processing audio data on their servers, giving them access to a great wealth of data for analytical and commercial uses.

Remember, personal data as well as "group" data is an assett to Google and its affilliates. The "big data" industry, which includes the sale and processing of all types of personal data (digital photos, live video, video files, voice recordings, web search/visit history, online purchases, etc...) is projected to be a 500 billion dollar industry by 2025.

Google needs Android to capture audio and video data (and all other usable personal digital information) and send it to their servers for analysis. Their business model is heavily dependent on the analysis and sales of your personal data, without restriction.

1
  • 1
    Well, it's known that it works that way. Hence my question was not "why is it thus", but "how to avoid this". So thanks for your explanation, Justin – but it does not answer my question. Still useful information for some. // Btw: no longer for me, I've meanwhile totally ditched Google stuff on my phones – which now run without the GApps package, so I'd have to rephrase my question to "how to achieve offline vouce recognition (without Google, only using FOSS)". – Izzy Jul 14 at 6:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.