Bug? XSpeechRecognizer by MultiverseApp error occurred message - serious problem

Mike1970

Well-Known Member
Licensed User
Longtime User
Hi eveyrone last year I made an app that uses XSpeechRecognizer by @Multiverse app library to detect words, infact you can see some posts of mine on the forum.
However I received a report that some useres experienced a crash of the app when they start the Speech To Text.

So I opened the project that I never touched after the release on Play Store a long time ago, I tried to start the same thing and infact something strange happened... the app crashed, and in logs I saw something related to
B4X:
Index: 0, Size: 0 Index Out Of Range
error, not very clear, probably on speech results sub...
So I decided to download all the new resources for B4A from official page, and actually I was a bit back with updates.

Now, the app instead of crashing on its own, displays this error message every x seconds even if I don't speak, but this dialog is NOT in my code, and to be sure of that I went back trying the original sample code of the library (original example) and the same happens now...

Screenshot_20230124_174532.jpg


If i try to say a word, the Event_obj_speech_onPartialResults(results As Object) fires, prints the word, BUT then also fires Event_obj_speech_onResults(Results As List) and then crashes because seems that Results is not initialized... i don't now what to do.
have I to switch to another speech to text library?.. there any better now? i need them to work offline.

Thanks in advance



P.S. in order to run the original example you have to add this to manifest:
B4X:
AddManifestText(<queries>
                  <intent>
                    <action
                       android:name="android.intent.action.TTS_SERVICE" />
                  </intent>
                  <intent>
                        <action android:name="android.speech.RecognitionService" />
                  </intent>
</queries>)

this in global:
B4X:
    Dim ok As Boolean = False

and this in the Create:
B4X:
    Dim rp As RuntimePermissions
    Do While Not(ok)
        rp.CheckAndRequest(rp.PERMISSION_RECORD_AUDIO)
        Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
        If Not(Result) Then
            Msgbox2Async("You must grant permission", "Grant Permission", "Ok", "", "", Null, False)
            Wait For Msgbox_Result (ResultMsg As Int)
        Else
            ok = True
        End If
    Loop
 

Mike1970

Well-Known Member
Licensed User
Longtime User
I see the problem but have no idea what is causing it. Actually there seem to be several different problems. I can only guess that Google has changed things for the worse yet again in recent Android versions.
That’s what I supposed too … but I don’t think to have the ability to spot the problem/solve it ?
 
Top