B4A Library SpeechRecognitionNoUI - Google Speech Recognition Without Popup

msmerce

Member
Licensed User
Longtime User
Thank you for your quick response. I've already read the Android documentation for "RecognitionListener". By the way, "onRmsChanged" also reads "There is no guarantee ...". Nevertheless the event is triggered. Probably this sentence only means that the event is not triggered on all devices. Is the event just not fired on your device, or is there an error when adding the event? Would it be possible to add the event so that everyone can try it for themselves?
 

Biswajit

Active Member
Licensed User
Longtime User
Update 1.5: Added BufferReceived event.
 

sn_nn

Member
Licensed User
Longtime User
Hi, Biswajit! Very nice library, but it working online only. Then i try work offline, i'm receiving message: "Network error". (Android 7.0). Is it possible work offline?
 

Biswajit

Active Member
Licensed User
Longtime User
Hi, Biswajit! Very nice library, but it working online only. Then i try work offline, i'm receiving message: "Network error". (Android 7.0). Is it possible work offline?
Don't know. I haven't faced this before. But as per stackoverflow if you are using a samsung device then change the speech API in the phone settings.
Also check if your device has the language (which you are using in your code) pack installed or not.
 

sn_nn

Member
Licensed User
Longtime User
Don't know. I haven't faced this before. But as per stackoverflow if you are using a samsung device then change the speech API in the phone settings.
Also check if your device has the language (which you are using in your code) pack installed or not.
Oukitel 10000K pro (Android 7.0), offline voice recognising is working with XSpeechRecogniser...
Configuration ia enabling offline recognising too.
 

Biswajit

Active Member
Licensed User
Longtime User
Oukitel 10000K pro (Android 7.0), offline voice recognising is working with XSpeechRecogniser...
Configuration ia enabling offline recognising too.
Could you post your code, how you are calling the StartListening method?
 

pas

Member
Licensed User
Longtime User
When using the sample code, it does not work when the the device is offline (WiFi disabled). Could somebody please describe any steps needed for this to work? Note the device being tested is running Android 9 and has the offline speech recognition files loaded and enabled via settings. Thank you.
 

kalikamtest

New Member
Hi friends, I did everything right, but what is the reason for this error?
test on xiaomi redmi 6 android 9 & Huawei y6

==================
Logger connected to: Xiaomi Redmi 6
--------- beginning of main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/content/ContextCompat;
at anywheresoftware.b4a.objects.RuntimePermissions.Check(RuntimePermissions.java:73)
at anywheresoftware.b4a.objects.RuntimePermissions.CheckAndRequest(RuntimePermissions.java:97)
at ir.yahoo98.brandsum.main._activity_resume(main.java:461)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at ir.yahoo98.brandsum.main.afterFirstLayout(main.java:111)
at ir.yahoo98.brandsum.main.access$000(main.java:17)
at ir.yahoo98.brandsum.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6820)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:922)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.ContextCompat" on path: DexPathList[[zip file "/data/app/ir.yahoo98.brandsum-JvTw7EfiUeeFKtvkPcgchA==/base.apk"],nativeLibraryDirectories=[/data/app/ir.yahoo98.brandsum-JvTw7EfiUeeFKtvkPcgchA==/lib/arm, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:171)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 20 more
 

Biswajit

Active Member
Licensed User
Longtime User
Hi, Google Speech limition Time is 60 seconds, but this library limition is 2. is any solution for it?
There is no limitation added externally to the library its a bridge between b4a to native android. Its based on the android SpeechRecognizer.
There is no option to extend the time limitation. If it detects silence for 2-3 sec then it will stop.

Google Speech limition Time is 60 seconds
Where did get this information?
 

PodSoft2016

Member
Sorry sir. i checked again and saw in silent mode limit time for disconnection is 6 seconds. its sufficient time for speaking,but 2 is less. as this code
 

Attachments

  • ax.png
    65.9 KB · Views: 204

PodSoft2016

Member
im so sorry sir. i checked language fa is 2 seconds and other language is 6 seconds. its strange but real. Tnx For your good library
 

Biswajit

Active Member
Licensed User
Longtime User
There is nothing I can do with the timing. Everything is happening in the system. The library is just invoking the process without the popup.
 

Biswajit

Active Member
Licensed User
Longtime User
Cookies are required to use this site. You must accept them to continue using the site. Learn more…