Dim VR As VoiceRecognition
Dim i As Intent
VR.Initialize("vr")
i.Initialize("android.speech.action.RECOGNIZE_SPEECH", "")
i.PutExtra("android.speech.extra.PREFER_OFFLINE", 1000)
VR.Listen2(i)
but the voice recognition is not working offline.
Does anybody know why its happening and if there is a way to fix it? (and how?)
You don't need to do anything special for this. If the speech engine supports offline mode then it will just work.
Tested with this code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
vr.Initialize("vr")
End Sub
Sub Activity_Click
vr.Listen
Wait For vr_Result (Success As Boolean, Texts As List)
Activity.Title = Texts
End Sub