[MOD][XPOSED][4.1+] GoogleOfflineVoice - Force offline voice recognition/typing

Search This thread

hillz

Senior Member
Jun 10, 2012
285
35
Indonesia
Introduction
The voice recognition API does not allow apps to choose whether they want to use offline voice recognition or not. There's no setting for the user either. Instead, if there's an internet connection, it'll always use the online services.
This module allows you to force offline voice recognition/typing. This is useful if you're using a slow connection, if you're connected to a local network (without internet access,) etc.

What does this module do?
This module can force offline voice recognition for apps that use Google Voice. It'll work if the app uses one of the following:
  • Voice typing (used by keyboards, e.g. SwiftKey)
  • Voice recognition (for apps that use RecognizerIntent such as utter!)
It does so by setting a variable that indicates whether a network connection is available or not to false.
Voice commands inside the Google Search app aren't affected. Note that if offline voice recognition doesn't work for you in the first place, this module won't fix that.

Requirements:

Broadcasts:
You can toggle some settings from e.g. Tasker using broadcasts. Just use these action names:
  • com.germainz.googleofflinevoice.enable - Enables the module.
  • com.germainz.googleofflinevoice.disable - Disables the module.
  • com.germainz.googleofflinevoice.enable_voice_ime - Enables the module for voice typing.
  • com.germainz.googleofflinevoice.disable_voice_ime - Disables the module for voice typing.
Example from the shell:
Code:
am broadcast -a "com.germainz.googleofflinevoice.disable"

Source code:
https://github.com/GermainZ/GoogleOfflineVoice

Download:
http://repo.xposed.info/module/com.germainz.googleofflinevoice

Changelog:
Code:
[B]1.2.1:[/B] The widget now uses images to indicate the module's state. This should fix text getting cut off on some devices.
[B]1.2:[/B] Fix for the latest Google Search. Revamped blacklist. Added a simple widget to toggle module status (useful to quickly enable/disable GoogleOfflineVoice from e.g. your home screen).
[B]1.1:[/B]
The voice typing setting wasn't working correctly (because of a typo - offline voice typing was never forced.) Also, there was another typo in strings.xml, as a reboot is actually *not* required for the settings to apply.
[B]1.0:[/B] Initial release.

Thanks:
  • rovo89 for the Xposed Framework.

Does this only work in English? I tried Indonesian language and it still needed an active internet connection to work. I'm using the default google keyboard on android kitkat
 

boogie16345

Member
Oct 5, 2014
15
1
OnePlus Nord N10 5G
great app

this app works great however only in the English language other languages are not supported probably because they are not downloaded to device . other languages or only online . any help would be great for the Greek language especially thank you
 

ill13

Member
Aug 28, 2007
15
2
Thank you!

I have a nexus 5 and the online speech-to-text conversion process / accuracy is horrendous and rage inducing. By forcing offline recognition I'm back to getting close to 100% correct dictation results!

Thank you very much!!!
 

s.sakti

New member
Jan 15, 2015
1
0
Hi, I have some question.
do I need to have a root access before I can use this module?
do I need to install the XposedFramework to make it works?
do you use any software to monitor the traffic to make sure it really work offline? if you do, can you tell me what is the software you use??
Thanks Before :)
 

GermainZ

Inactive Recognized Developer / Retired Forum Mod
Aug 3, 2012
6,170
8,805
Hi, I have some question.
do I need to have a root access before I can use this module?
do I need to install the XposedFramework to make it works?
do you use any software to monitor the traffic to make sure it really work offline? if you do, can you tell me what is the software you use??
Thanks Before :)
I use Bytes Insight. Please read the OP (and linked threads) for your other questions.
 

MordyT

Senior Member
Dec 15, 2008
446
93
Milwaukee WI
mordyt.com
Hello, been using this mod for a long while (almost year maybe). Recently it seems to have stopped working as expected. Whenever I do voice typing I always see data go active even if there's nothing else going on, stopping voice typing immediately kills the data connection. It also is just as slow as when I was using online mode before this mod. Where should I start troubleshooting this? Nexus 5 stock rom, 4.4.4 latest stable xposed.

Sent from my Nexus 5
 
  • Like
Reactions: GermainZ

martuseich

Senior Member
Mar 6, 2009
361
188
I've been searching "Google Voice Search Not working" for answers with no success as yet.

When I attempt to use the voice recognition typing via Swiftkey (wifi connected) I get the "Speak Now" popup with the Mic icon changing as I speak indicating it is indeed "hearing" me speak, then I get a "Connection Problem" popup as expected being that I have Voice Search(10345) blocked via AFWall app (AFWall is also posting a toast telling me it has blocked Voice Search).

Shouldn't GoogleOfflineVoice function in this state?

I'm using Xprivacy as well, which shows what permissions apps are requesting and allows me to allow or deny permissions requests. I can see that Voice Search is requesting the following permissions:

-accounts/getAccountsByType com.google
-internet/connect www. google. com:80
-location/RequestLocationUpdates
-location/RequestLocationUpdates network
-internet/networkinfo is.connected
-media/audio.startrecording
-accounts/gethAuthtoken
-internet/inetaddress.getbyname 74.125.196.103
-internet/connect 74.125.196.103:80
-internet/inetaddress.getbyname 74.125.196.104
-internet/connect 74.125.196.104:80
-internet/inetaddress.getbyname 74.125.196.105
-internet/connect 74.125.196.105:80
-internet/inetaddress.getbyname 74.125.196.106
-internet/connect 74.125.196.106:80
-internet/inetaddress.getbyname 74.125.196.99
-internet/connect 74.125.196.99:80
-internet/inetaddress.getbyname 74.125.196.147
-phone/Configuration.MCC
-phone/Configuration.MNC
-shell/LoadLibrary voicesearch
-identification/serial (Original serial#)
-internet/inet
-storage/sdcard


When I grant access to Google Voice Search through AFWall (with internet connection, GoogleOfflineVoice disabled in Xposed) it functions without issue & types whatever I say.

When I try to use voice typing through Swiftkey with no internet connection and GoogleOfflineVoice disabled in Xposed I get the "Connection Problem" error message.

That suggests Android Offline Voice option isn't functioning properly.

Is there a setting somewhere that I need to adjust? Any ideas what the issue might be?


Sprint Samsung Note 4
Rooted
X-Note ROM Kitkat 4.4.4
Xposed 2.6.1
Google Offline Voice v 1.2.1
 
  • Like
Reactions: GermainZ

GermainZ

Inactive Recognized Developer / Retired Forum Mod
Aug 3, 2012
6,170
8,805
Thanks for the reports. It probably isn't working with the latest Google Search app (this has nothing to do with Lollipop), but I won't me able to take a look before some time, once Xposed is compatible with my device/ROM.
 

martuseich

Senior Member
Mar 6, 2009
361
188
Bummer

I HATE Big Brother Google forcing me to grant them access to however they want to use my camera & mic permissions (they probably access them elsewhere through the OS anyway). Call me conspiracy theorist but since Google maintains records of everything we ever search & NSA has been found to spying on U.S. citizens & recording all we ever do as well, I'd like to do whatever I can to thwart their every effort. I have nothing to hide but my privacy is mine (or at least should be).

I love using your mod so I'm not forced to go through Google. Until then, cutting off Swiftkey's access to the internet & Google's & other apps access to my mic, camera & storage (where I can) & continuing to type.

Thanks for all your effort. Looking forward to any updates you may offer. If I can help in troubleshooting in any way, give me a shout.
 
  • Like
Reactions: sirgrot

Ohmster

Senior Member
Sep 5, 2011
2,264
1,487
Pompano Beach
Doesn't appear to work XT912 - SOLVED

Issue Solved! Details at bottom in Edit section.

@GermainZ and other experienced members:

Device: Motorola Droid Razr XT912, CM11 Kit Kat rom, TI OMAP 4430 Chipset, ARM7 Cortex A9

I use Google Voice Typing all the time. I never type text messages and always use Google Voice Typing to make my text
messages. I have had this module installed for many, many months, but never could tell if it was "doing anything". Lately I have had some connection issues, I guess (Orange bars for signal icon) and get a message while trying that "Offline mode unavailable. Try again". The red mic ball would pulse as I speak and nothing would appear on the screen. Before I hit the end of the sentence, I get the message above.

To double check, I tapped airplane mode and tried again. This time the red mic ball would come up and not pulse, I would immediately get the Unavailable message. I check settings for Voice and for "Offline Speech Recognition" I can manage downloaded languages. I have English US installed. I have "OK Google Detection" off. There appears to be no other settings for offline voice and it does not seem to work at all.

Huh, isn't this wonderful module supposed to fix this? I am not complaining. I am just trying to get some help/advice here. If the module will not work on my OMAP4 device then I should uninstall it. An XT912 phone does not have hardware power to burn so unnecessary modules and apps have to go. Please help or advice.

Am I missing something or should I just uninstall it. Otherwise regular voice typing really work well with this phone. I could not do email, forum posts, or text messages without it. Are there any other apps or fixes that could make this work. I am really puzzled and must get to the bottom of this. Thank you GermainZ for making such a useful app. Even if it will not work for me. :eek:

EDIT: Offline speech recognition - getting it to work
After a bit of searching, I found the answer in an XDA Nexus 7 thread. Original Post is here:
Nexus 7 offline speech recognition - getting it to work

What worked for me:
  1. Go into Language and Input Settings, changed Language at top to English (United States). Previously I had this set to English (United Kingdom) as it was the only way to get Google Navigation to speak in my SVOX Victoria UK Female voice that I bought and paid for.
  2. Settings for Android Keyboard, verified input language checked for "English (US)". Removed the English (UK) check-mark.
  3. Verified "Google voice typing" is checked and set to Automatic.

Retested in airplane mode, this works great now! Thank you all very much for making this module. :good:

Actual Post that helped me, this text got him a Thanks number of 63! Apparently this is a BIG issue. Credit to @droiduser63

After stumbling around on this trying to get it to work offline, I found TWO more key bits of information to make it happen.

Settings
Language & Input
Under KEYBOARD & INPUT METHODS section,
Click the SETTINGS icon to the right of "Android Keyboard"
Input Languages MUST BE SET TO "English (US)" (I assume to match my downloaded language file).
Ensure the checkbox is enabled beside "Google voice typing", and set to "automatic" (it can't be a mismatch from the "Android keyboard" setting or again it won't work).

None of this seems to be a problem if you've got your overall language setting to be English (United States) and are using the default "use system language" option for Android Keyboard. In other words, it's tweaked to work fine for US users, but others need to fiddle.

Steve
 
Last edited:

xxBrun0xx

Senior Member
Jan 1, 2012
2,304
713
CT
Samsung Galaxy Z Fold2
Do does anybody know if this works with lollipop? Used to use this module on my moto x and was fantastic! As far as I know, if you have Internet, Google will always use it to decipher your voice commands, which can be slow. So testing in airplane mode really doesn't tell you anything. This module forces Google voice search to always search offline, even when there is a network connection, which is much faster than using the Web to translate voice to text.
 

GermainZ

Inactive Recognized Developer / Retired Forum Mod
Aug 3, 2012
6,170
8,805
Do does anybody know if this works with lollipop? Used to use this module on my moto x and was fantastic! As far as I know, if you have Internet, Google will always use it to decipher your voice commands, which can be slow. So testing in airplane mode really doesn't tell you anything. This module forces Google voice search to always search offline, even when there is a network connection, which is much faster than using the Web to translate voice to text.
http://xdaforums.com/showpost.php?p=59070977&postcount=91
 

aniruddha999

New member
Nov 25, 2015
4
0
NOT working

i have installed as u mentioned , but after rebooting its say same" "offline mode unavailable " ,. i am using jelleybean samsung gt s7262" help me
 

chiruscan

Senior Member
Mar 8, 2012
497
121
Any updates on this? I just discovered this module yesterday lol

Downloaded and tried it. Not sure if its working or not. I put it in airplane mode and was able to voice dial a call and open apps successfully then turned on wifi and it did it as well.
 
Last edited:

Izzysoft

Senior Member
Thanks for the reports. It probably isn't working with the latest Google Search app (this has nothing to do with Lollipop), but I won't me able to take a look before some time, once Xposed is compatible with my device/ROM.

No pressure, just asking: As your statement was made more than a year ago, are there any plans to make the module working again? Maybe even an "expected time" when an update might be available?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 27
    Introduction
    The voice recognition API does not allow apps to choose whether they want to use offline voice recognition or not. There's no setting for the user either. Instead, if there's an internet connection, it'll always use the online services.
    This module allows you to force offline voice recognition/typing. This is useful if you're using a slow connection, if you're connected to a local network (without internet access,) etc.

    What does this module do?
    This module can force offline voice recognition for apps that use Google Voice. It'll work if the app uses one of the following:
    • Voice typing (used by keyboards, e.g. SwiftKey)
    • Voice recognition (for apps that use RecognizerIntent such as utter!)
    It does so by setting a variable that indicates whether a network connection is available or not to false.
    Voice commands inside the Google Search app aren't affected. Note that if offline voice recognition doesn't work for you in the first place, this module won't fix that.

    Requirements:

    Broadcasts:
    You can toggle some settings from e.g. Tasker using broadcasts. Just use these action names:
    • com.germainz.googleofflinevoice.enable - Enables the module.
    • com.germainz.googleofflinevoice.disable - Disables the module.
    • com.germainz.googleofflinevoice.enable_voice_ime - Enables the module for voice typing.
    • com.germainz.googleofflinevoice.disable_voice_ime - Disables the module for voice typing.
    Example from the shell:
    Code:
    am broadcast -a "com.germainz.googleofflinevoice.disable"

    Source code:
    https://github.com/GermainZ/GoogleOfflineVoice

    Download:
    http://repo.xposed.info/module/com.germainz.googleofflinevoice

    Changelog:
    Code:
    [B]1.2.1:[/B] The widget now uses images to indicate the module's state. This should fix text getting cut off on some devices.
    [B]1.2:[/B] Fix for the latest Google Search. Revamped blacklist. Added a simple widget to toggle module status (useful to quickly enable/disable GoogleOfflineVoice from e.g. your home screen).
    [B]1.1:[/B]
    The voice typing setting wasn't working correctly (because of a typo - offline voice typing was never forced.) Also, there was another typo in strings.xml, as a reboot is actually *not* required for the settings to apply.
    [B]1.0:[/B] Initial release.

    Thanks:
    • rovo89 for the Xposed Framework.
    4
    New version out, v1.2. Changes:
    • Fix for the latest Google Search;
    • Revamped blacklist;
    • Added a simple widget to toggle module status (useful to quickly enable/disable GoogleOfflineVoice from e.g. your home screen.)
    Note that the previous blacklist settings will be lost. I also recommend clearing the application's data to get rid of the old, now unused, blacklist.
    3
    The latest Google Search update breaks this module. Attached is a beta with the following changes:
    • Fix for the latest Google Search;
    • Revamped blacklist.
    Note that the previous blacklist settings will be lost. I also recommend clearing the application's data to get rid of the old, now unused, blacklist.

    It'd be great if there would be an option to disable this module on certain wifi-networks only.
    Also, a widget or notification to turn this module on/off would be great.
    I haven't looked into this yet, but FYI, you can do this using e.g. Tasker and intents (see OP.) Just thought I'd mention it if you want that functionality straight away.
    2
    I don't know if I understand this clearly - this will able me to use Google Now voice recognition and Swiftkey voice typing when there's no data connection? But I'll still be able to use it when data is on?
    No. On Jelly Bean and higher, you can already use offline voice recognition/typing. That only happens when you're not connected at all, though. You can't force it if you're using a slow connection or if you're connected to a WiFi that's local (no internet access.) This module allows you to do that. I personally use it for SwiftKey and utter! because I find online recognition is too slow - at least with my internet connection.
    2
    It'd be great if there would be an option to disable this module on certain wifi-networks only.
    Also, a widget or notification to turn this module on/off would be great.
    I need to check if the module still works with the latest Google Search update. I also want to revamp the blacklist as the current implementation is quite buggy. Once I get enough time to do that, I'll look into your suggestions. ?