Offline Speech Recognition in qpython3
<p>I have been trying to make a qpython program that uses <code>sl4a.Android.recognizeSpeech</code> function. The functionality works fine online. </p>

<p>In my phone settings, I turned on and downloaded offline speech recognition and google now works fine offline, but the python speech does not work at all, asking me to try again every single time.</p>

<p>Sample Code:</p>

<pre><code>import sl4a 
import time

droid = sl4a.Android()

def speak(text):
    droid.ttsSpeak(text)
    while droid.ttsIsSpeaking()[1] == True:
        time.sleep(1)

def listen():
    return droid.recognizeSpeech('Speak Now',None,None)

def login():
    speak('Passphrase, please')
    try:
        phrase = listen().result.lower()
    except:
        phrase = droid.dialogGetPassword('Passphrase').result
    print(phrase)
    if phrase == 'pork chops':
        speak('Welcome')
    else:
        speak('Access Denied')
        exit(0)

login()
</code></pre>