hi everyone, i just converted a project from b4a standard to b4xpages.
everything seems to be working, except for the xSpeechRecognizer that in the Standard project works, and in the b4xpages version not.
When i click the button to start the listening this check fails:
I think the problem is here
The library is this:
Thanks in advance
everything seems to be working, except for the xSpeechRecognizer that in the Standard project works, and in the b4xpages version not.
When i click the button to start the listening this check fails:
B4X:
If Obj_speech.IsRecognitionAvailable Then '<------------ here'
'Turn it on
Obj_speech.Start
'Start listening
Obj_speech.StartListening
Sleep(50)
SetState(False)
Else
MsgboxAsync("No Recognizer", "Error")
End If
I think the problem is here
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
...
Dim ok As Boolean = False
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("Devi acconsentire per poter fare il test", "Consenti l'accesso", "Ok", "", "", Null, False)
Wait For Msgbox_Result (ResultMsg As Int)
Else
ok = True
End If
Loop
'Obj_speech.Initialize(Me, "Event_obj_speech", 0, 0) '<----- Tried also like so
Obj_speech.Initialize(B4XPages.GetNativeParent(Me), "Event_obj_speech", 0, 0) '<-------------------------- HERE
End Sub
The library is this:
Android Speech Recognition API Wrapper
Here is a wrapper for the Android speech recognition API using JavaObject complete with Source code. It's based on the code found here: http://www.truiton.com/2014/06/android-speech-recognition-without-dialog-custom-activity/ There is not much to it, if you create a new project, you just need...
www.b4x.com
Thanks in advance